Skip to content

Instantly share code, notes, and snippets.

View Lewiscowles1986's full-sized avatar
🤓

Lewis Cowles Lewiscowles1986

🤓
View GitHub Profile
@prwhite
prwhite / Makefile
Last active October 4, 2023 20:39
Add a help target to a Makefile that will allow all targets to be self documenting
View Makefile
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@ffoodd
ffoodd / improved-sr-only.markdown
Last active October 3, 2023 01:52
Improved .sr-only
View improved-sr-only.markdown
@magnetikonline
magnetikonline / README.md
Last active September 30, 2023 14:59
Setting Nginx FastCGI response buffer sizes.
View README.md
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active September 26, 2023 06:24
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@Savelenko
Savelenko / GADTMotivation.fs
Last active September 16, 2023 01:25
Motivated simulation of GADTs in F#, quite motivational
View GADTMotivation.fs
module GADTMotivation
(*
Here is a simple motivational example for GADTs and their usefulness for library design and domain modeling. Suppose we
need to work with settings which can be displayed and adjusted in a GUI. The set of possible setting "types" is fixed
and known in advance: integers, strings and booleans (check-boxes).
The GUI should show an example value for each possible setting type, e.g. 1337 for an integer setting and "Hello" for a
string setting. How can we model this small domain of setting types and computing example values?
*)
@lyshie
lyshie / config-deb-i386.json
Last active September 9, 2023 22:00
Scratch Desktop (Scratch 3.0 Offline Editor) on GNU/Linux
View config-deb-i386.json
{
"src": "/tmp/scratch-desktop/",
"dest": "/tmp/",
"arch": "i386",
"icon": "/tmp/scratch-desktop/resources/Icon.png",
"categories": [
"Education"
]
}
@jessfraz
jessfraz / boxstarter.ps1
Last active September 4, 2023 12:03
Boxstarter Commands for a new Windows box.
View boxstarter.ps1
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@samsamm777
samsamm777 / gist:7230159
Last active September 4, 2023 11:20
PHP set private property value using reflection. This allows you to set a private property value from outside the object, great for PHPUnit testing.
View gist:7230159
<?php
$a = new A();
$reflection = new \ReflectionClass($a);
$property = $reflection->getProperty('privateProperty');
$property->setAccessible(true);
$property->setValue($a, 'new-value');
echo $a->getPrivateProperty();
//outputs:
@alexellis
alexellis / k8s-pi.md
Last active August 29, 2023 15:29
K8s on Raspbian
View k8s-pi.md
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"