Skip to content

Instantly share code, notes, and snippets.

@mlconnor
mlconnor / country_date_formats.csv
Created February 22, 2012 20:49
Listing of countries with their preferred date formats, ISO3166 code, ISO629-2
ISO 3166 Country Code ISO639-2 Country Code Country ISO 3166 Country Code ISO639-2 Lang Language Date Format
ALB AL Albania sqi sq Albanian yyyy-MM-dd
ARE AE United Arab Emirates ara ar Arabic dd/MM/yyyy
ARG AR Argentina spa es Spanish dd/MM/yyyy
AUS AU Australia eng en English d/MM/yyyy
AUT AT Austria deu de German dd.MM.yyyy
BEL BE Belgium fra fr French d/MM/yyyy
BEL BE Belgium nld nl Dutch d/MM/yyyy
BGR BG Bulgaria bul bg Bulgarian yyyy-M-d
BHR BH Bahrain ara ar Arabic dd/MM/yyyy
@psybers
psybers / package.json
Created April 6, 2024 02:24
Finds uncategorized transactions in Actual Budget and asks Chat GPT to suggest the category.
{
"dependencies": {
"@actual-app/api": "^6.7.0",
"dotenv": "^16.4.5",
"openai": "^4.33.0"
}
}
@defparam
defparam / MutateMethods.py
Last active April 24, 2024 11:57
Example of using Turbo Intruder in a "listen and attack" mode. Because turbo intruder's jython interpreter is technically inside burp you can have turbo intruder scripts use the plugin API. Here we use burp.IProxyListener to intercept requests and reissue them inside turbo intruder mutating the method.
from threading import Thread
import time
class TrafficMagnet(burp.IProxyListener):
def __init__(self):
callbacks.registerProxyListener(self)
self._helpers = callbacks.getHelpers()
self._callbacks = callbacks
@werneckpaiva
werneckpaiva / rc-arduino.ino
Last active April 24, 2024 11:55
Read RC channels from Arduino
#define CH1 3
#define CH2 5
#define CH3 6
#define CH4 9
#define CH5 10
// Read the number of a given channel and convert to the range provided.
// If the channel is off, return the default value
int readChannel(int channelInput, int minLimit, int maxLimit, int defaultValue){
int ch = pulseIn(channelInput, HIGH, 30000);
@almost
almost / countries.json
Last active April 24, 2024 11:54 — forked from keeguon/countries.json
A list of countries along 2 letter ISO codes in JSON format (the gist I forked from was valid JS but not valid JSON)
[
{"name": "Afghanistan", "code": "AF"},
{"name": "Åland Islands", "code": "AX"},
{"name": "Albania", "code": "AL"},
{"name": "Algeria", "code": "DZ"},
{"name": "American Samoa", "code": "AS"},
{"name": "AndorrA", "code": "AD"},
{"name": "Angola", "code": "AO"},
{"name": "Anguilla", "code": "AI"},
{"name": "Antarctica", "code": "AQ"},
@threez
threez / update_keystore_ldap.sh
Created March 3, 2014 10:20
Extract and update a ldap certificate in a java keystore (jenkins)
#!/bin/bash
LDAP_SERVER=example.com:636
ALIAS=LDAP_SERVER
KEYSTORE=/usr/lib/jvm/java-1.6.0-openjdk-amd64/jre/lib/security/cacerts
PASSWD=changeit
# grep the certificate
echo -n | openssl s_client -connect $LDAP_SERVER | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ldaps.crt
<?php
declare(strict_types=1);
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\math\VoxelRayTrace;
use pocketmine\player\Player;
use pocketmine\scheduler\CancelTaskException;
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 24, 2024 11:51
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@BitPhinix
BitPhinix / binding.tsx
Last active April 24, 2024 11:49
yjs react binding
import React, { useMemo, useSyncExternalStore } from "react";
import {
type SharedArray,
type SharedDoc,
type SharedMap,
type SharedType,
type ToJson,
type ToJsonDeep,
} from "./types.ts";
@rysstad
rysstad / Install-MSIPackage.ps1
Last active April 24, 2024 11:49
Install MSI package silently with powershell
$msiPackageToInstall = "<path to .msi>"
# save log from installation to temp file
$tmpFile = [System.IO.Path]::GetTempFileName()
Start-Process msiexec -ArgumentList "/i $msiPackageToInstall /qn /L*v $tmpFile" -NoNewWindow -Wait