Skip to content

Instantly share code, notes, and snippets.

@vincentchalamon
vincentchalamon / CustomCalendarPeriod.php
Last active January 16, 2025 10:55
Polymorphism with API Platform
<?php
#[ApiResource(
operations: [
// no GetCollection operation
new Get(...),
new Post(...),
new Patch(...),
],
)]
@rxaviers
rxaviers / gist:7360908
Last active January 16, 2025 10:54
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active January 16, 2025 10:53
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@cfaria
cfaria / migrateorders.php
Last active January 16, 2025 10:51 — forked from maddisondesigns/migrateorders.php
Migrate WooCommerce Orders
<?php
//increase max execution time of this script to 150 min:
ini_set('max_execution_time', 9000);
//increase Allowed Memory Size of this script:
ini_set('memory_limit','960M');
// Copies woocommerce orders and users over from source to target.
// I use this on my local machine - loading both db's up there side by side
// could easily adjust the connect strings to connect elsewhere if needed.
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
namespace Unity.Entities
Two pointers: one input, opposite ends
```python3
def fn(arr):
left = ans = 0
right = len(arr) - 1
while left < right:
# do some logic here with left and right
if CONDITION:
@akabe1
akabe1 / frida_multiple_unpinning.js
Last active January 16, 2025 10:41
Another Android ssl certificate pinning bypass for various methods
/* Android ssl certificate pinning bypass script for various methods
by Maurizio Siddu
Run with:
frida -U -f <APP_ID> -l frida_multiple_unpinning.js [--no-pause]
*/
setTimeout(function() {
Java.perform(function() {
console.log('');
@kohske
kohske / gist:1150934
Created August 17, 2011 06:34
How to install development version of ggplot2
# install devtools
install.packages('devtools')
# install dependency of scales package
install.packages(c("RColorBrewer", "stringr", "dichromat", "munsell", "plyr", "colorspace"))
# load devtools
library(devtools)
# move to development mode
@jvranish
jvranish / stack_traces.c
Last active January 16, 2025 10:32
An example of catching exceptions and printing stack traces in C on Windows, Linux and OS X
/* compile with:
on linux: gcc -g stack_traces.c
on OS X: gcc -g -fno-pie stack_traces.c
on windows: gcc -g stack_traces.c -limagehlp
*/
#include <signal.h>
#include <stdio.h>
#include <assert.h>
@bobuk
bobuk / .wezterm.lua
Created December 27, 2024 15:26
.wezterm.lua
local wezterm = require("wezterm")
local config = wezterm.config_builder()
config.color_scheme = "Earthsong"
config.window_frame = {
font_size = 12,
}
config.command_palette_font_size = 16
config.tab_bar_at_bottom = true
config.hide_tab_bar_if_only_one_tab = false
config.window_decorations = "RESIZE"