Skip to content

Instantly share code, notes, and snippets.

@petersuhm
petersuhm / circle.yml
Last active May 4, 2024 15:27
Example CircleCi configuration for WP Pusher
machine:
timezone:
Europe/Copenhagen
php:
version: 5.3.3
# This will be added to the `/etc/hosts` file
hosts:
wppusher-plugin.dev: 127.0.0.1
@ThePlenkov
ThePlenkov / boot.sh
Last active May 4, 2024 15:26
Resolve WSL DNS automatically
#!/bin/bash
# Remove existing "nameserver" lines from /etc/resolv.conf
sed -i '/nameserver/d' /etc/resolv.conf
# Run the PowerShell command to generate "nameserver" lines and append to /etc/resolv.conf
# we use full path here to support boot command with root user
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command '(Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses | ForEach-Object { "nameserver $_" }' | tr -d '\r'| tee -a /etc/resolv.conf > /dev/null
@rxaviers
rxaviers / gist:7360908
Last active May 4, 2024 15:22
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:
@upsuper
upsuper / delayed_balance.py
Created June 27, 2021 10:29
Beancount plugin to handle transactions geting delayed and not being included in the next bank statement
#!/usr/bin/env python3
# Copyright (C) 2021 Xidorn Quan
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@bbengfort
bbengfort / counter.go
Created September 19, 2022 15:19
Atomic vs Mutex Counter Benchmark
package counter
import (
"sync"
"sync/atomic"
)
type Counter interface {
Inc()
Load() uint64
@pthavarasa
pthavarasa / mysqldump.php
Created August 19, 2022 17:59
Easy way to dump ( backup ) MySQL database with PHP script
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$user = 'wordpress';
$pass = 'password';
$host = 'localhost';
@dr-vortex
dr-vortex / aliases.sh
Last active May 4, 2024 15:18
Useful `git` aliases
#!/bin/bash
# Adds some useful git aliases
echo "Adding aliases"
# Lists all of the changes (i.e. commit messages) from the last tag to HEAD
# "- " prefixed before each line for easily making a markdown list
git config --global alias.ls-changes '!git log --format=%B $(git describe --tags --abbrev=0)..HEAD | grep -v -e "^$" | sed -e "s/^/- /"'
@xunker
xunker / pocsag_fortune.sh
Last active May 4, 2024 15:18
Send text to POCSAG pager using rpitx
# Send a page to a POCSAG pager using rpitx (https://github.com/F5OEO/rpitx).
# Place this script in the root directory of the rpitx repo when you check it out.
#
# Requires the `fortune` program to be installed: `sudo apt-get install fortune`
#
# In default config, set to transmit to an Apollo AL-A25 pager.
CAPCODE="0268778A"
FREQUENCY=157740000
BAUD=512
FORTUNE=$(fortune | tr '\n' ' '); echo $FORTUNE; printf "$CAPCODE:$FORTUNE" | sudo ./pocsag -f $FREQUENCY -r $BAUD
@m-Phoenix852
m-Phoenix852 / discord-token-logger.js
Created August 26, 2020 07:45
Simple script to log in to discord account using token.
let token = "your token";
function login(token) {
setInterval(() => {
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}
@kyo-takano
kyo-takano / making-the-most-of-local-llms.ipynb
Last active May 4, 2024 15:12
ローカルLLMはこーやって使うの💢
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.