Skip to content

Instantly share code, notes, and snippets.

@TeMPOraL
TeMPOraL / init-web-server.el
Created April 3, 2018 21:45
Serve files over HTTP directly from Emacs.
;;;; A webserver in Emacs, because why not.
;;;; Basically a fast replacement for serve_this in Fish.
(use-package web-server
:config
(defvar my/file-server nil "Is the file server running? Holds an instance if so.")
(defun my/ws-start (handlers port &optional log-buffer &rest network-args)
@oliveratgithub
oliveratgithub / emojis.json
Last active May 24, 2024 08:06
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z
@lvm
lvm / bassy.scd
Last active December 1, 2016 00:59
\bassy synthdef for supercollider (and superdirt)
SynthDef(\bassy, {|out=0, freq=440, ctf=1000, rq = 0.5, attack=0.001, release=1, lpcutoff=5000, amp=0.1, mul=1, pan=0.5|
var sig = LFSaw.ar(freq) * 0.5;
var env = EnvGen.ar(Env.perc(attack, release), doneAction:2);
sig = mul * BHiPass.ar(RLPF.ar(sig, lpcutoff*env, rq), ctf, rq);
OffsetOut.ar(out, DirtPan.ar(sig*amp, ~dirt.numChannels, pan, env))
}).add;
@svileng
svileng / compile
Last active November 24, 2016 03:17
Elixir LDN Examples
info "Building Phoenix static assets"
npm run build
mix phoenix.digest
@joshdover
joshdover / README.md
Last active September 28, 2023 21:38
Idiomatic React Testing Patterns

Idiomatic React Testing Patterns

Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.

Setup

I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a beforeEach. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern that gives great defaults for each test example but allows every example to override props when needed:

@tom-galvin
tom-galvin / c-gradient.rb
Created March 31, 2015 10:27
DailyProgrammer Challenge #208i Solution (ASCII Gradient Generator)
module C208i
class Gradient
def initialize(gradient)
if gradient.length > 0
@chars = gradient.chars
else
raise Exception.new("Gradient string must not be empty.")
end
end
# Solution to this problem
# from http://www.reddit.com/r/dailyprogrammer/comments/2ug3hx/20150202_challenge_200_easy_floodfill/
#
# Mimicing this python solution in Ruby
# http://www.reddit.com/r/dailyprogrammer/comments/2ug3hx/20150202_challenge_200_easy_floodfill/co83w1u
def floodfill(instream, outstream)
width, height = instream.gets.split.map &:to_i
grid = Array.new(height) { instream.gets }
x, y, newchar = instream.gets.split
@adamcooke
adamcooke / dsl.rb
Created November 7, 2014 15:20
The complete code from my DSL tutorial at http://blog.atechmedia.com/ruby-dsls-for-fun/
class AddressBook
def contacts
@contacts ||= []
end
def self.load_from_path(path)
# Create a new AddressBook instance
address_book = self.new
# Create a new AddressBookDSL instance
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 19, 2024 17:40
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@brianfryer
brianfryer / gist:5987888
Created July 12, 2013 21:12
cornsole.log()
var cornsole = {
log: function(txt) {
var cornhole = atob('ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC4tLS0tLS0tLS0tLS0tLg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyAgICAgICAgICAgICAgIFwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyAuLS0tLS0uICAgICAgICAgXA0KSSBhbSB0aGUgR3JlYXQgQ29ybmhvbGlvISEgICAgICAgICB8LyAtLWAtYC1cICAgICAgICAgXA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgXCAgICAgICAgfA0KSSBuZWVkIFRQIGZvciBteSBidW5naG9sZSEhICAgICAgICAgfCAgIF8tLSAgIFwgICAgICAgfA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3wgPS0uICAgICB8ICAgICAgfA0KQ29tZSBvdXQgd2l0aCB5b3VyIHBhbnRzIGRvd24hICAgICAgb3wvby8gICAgICB8ICAgICAgfA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyAgfiAgICAgICB8ICAgICAgfA0KQVJFIFlPVSBUSFJFQVRFTklORyBNRT8/ICAgICAgICAgIChfX19fQCkgIF9fXyB8ICAgICAgfA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfPT09fn5+LmB8ICAgICAgfA0KT2guIGhlaC1oZWguICBTb3JyeSBhYm91dCB0aGF0LiAgIF9fX19fX18uLS1+ICB8ICAgICAgfA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcX19fX19