Skip to content

Instantly share code, notes, and snippets.

View sourcevault's full-sized avatar

sourcevault

View GitHub Profile
@jumper047
jumper047 / AutoHotkey.ahk
Last active March 21, 2023 16:13
AHK config
;Recommended, but not required:
SendMode Input
#NoEnv
#SingleInstance force
#Include <dual/dual>
dual := new Dual
#Include <dual/defaults>
@jimfrenette
jimfrenette / hvm.sh
Last active July 15, 2023 00:40
Hugo version switcher and installer tested with Linux and OS X 64 bit releases from https://github.com/gohugoio/hugo/releases
#!/usr/bin/env bash
# the directory that contains this script
base=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
# -----------------------
# Hugo Version Manager
# Author: Jim Frenette
# May 21, 2019
@dominikwilkowski
dominikwilkowski / Readme.md
Last active October 9, 2024 15:00
How to install a man page into a node.js app

How to install a man page into a node.js app

Cuttlebelle man page

Installing a man page is not easy as there are little infos out there about it.

After a lot of trial and error, google searches and alpha publishing my app I finally have a collection of things I need to do to get it working:

@ysr23
ysr23 / pi zero W ap setup.md
Last active September 18, 2024 14:50
Raspberry Pi Zero W Access Point (ap) setup

These are my own personal notes on how i setup a Pi Zero W as an access points it is a blatant copy of this: https://gist.github.com/tcg/0c1d32770fcf6a0acf448b7358c5d059 but is just missing a couple of things from: http://imti.co/post/145442415333/raspberry-pi-3-wifi-station-ap and like tcg, this is not intended as a guide but notes as i will invariably have to rebuild this sometime and i have broken biscuits for brains.

1. making the pi zero accesible from a computer

this is really just the same info as here https://gist.github.com/gbaman/975e2db164b3ca2b51ae11e45e8fd40a

  • flash raspbian lite to sd card
  • unplug and replug sd card adapter if necessary to see 'boot' drive
  • edit cmdline.txt add: modules-load=dwc2,g_ether after the word rootwait
  • edit config.txt and add dtoverlay=dwc2 to the end of the file
  • create a blank file called ssh
@Avaq
Avaq / combinators.js
Last active September 26, 2024 18:53
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@randrews
randrews / hoc4.lua
Created June 21, 2015 20:53
Toy calculator in Lua, version 4
setmetatable(_ENV, { __index=lpeg })
Scopes = { {} }
function eval_expr(expr)
local accum = eval(expr[2]) -- because 1 is "expr"
for i = 3, #expr, 2 do
local operator = expr[i]
local num2 = eval(expr[i+1])
@randrews
randrews / hoc2.lua
Created June 3, 2015 04:45
Toy calculator in Lua, version 2
setmetatable(_ENV, { __index=lpeg })
VARS = {}
function eval(...)
local args = {...}
local accum = args[1]
for i = 2, #args, 2 do
local operator = args[i]
local num2 = args[i+1]
@rosswd
rosswd / multi-git-win.md
Last active November 9, 2024 17:31
Setting up a Github and Bitbucket account on the same computer on Mac OS. Now with a guide for Windows 10.

Setting up github and bitbucket on the same computer (Windows)

Guide for Windows

mix3d asked for some help using this guide with windows so here we go. This was tested with Windows 10. Run all commands in Git Bash once it's installed.

Github will be the main account and bitbucket the secondary.

Git for Windows

  • Download and install Git for Windows
    • In the installer, select everything but decide if you want a desktop icon (2nd step)
@clausreinke
clausreinke / bind-for-arrows.html
Created July 12, 2013 21:11
using _this=this to emulate arrow functions is fast but error-prone, requiring non-trivial analysis for use in transpilers. using .bind to emulate arrow functions is simpler, but slow in current engines. using an apply-based partial polyfill (bind) for .bind is fast in v8, slow in other engines.
// <script>
/* sample output
$ node ../bind-for-arrows.html
_this: 4ms
.bind: 25ms
bind: 4ms
_this, calls only: 1ms
.bind, calls only: 4ms
bind, calls only: 0ms
@datagrok
datagrok / git-branch-simplify.md
Last active April 16, 2024 17:26
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.