Skip to content

Instantly share code, notes, and snippets.

/* dragging logic for nomadlist.com/dating */
/* by @levelsio */
/* MIT license */
/* <dragging logic> */
$('body').on('mousedown touchstart','.card',function(e) {
if(!currentCardUserId) return;
if($('card.match_card').is(':visible')) return;
if(typeof e.originalEvent.touches !=='undefined') {
/* touch device */
@felipetavares
felipetavares / simple_useful_slow.js
Last active December 15, 2020 12:39
Simple, Useful and Slow: Assorted Reference Statistics Functions (utf-8)
// Simple, Useful and Slow
// Assorted Reference Statistics Functions
// UTF-8 Edition
// Shorthands
pow = Math.pow
sqrt = Math.sqrt
pi = Math.PI

Code Review

A consolidation of advice and stuff from the internet

What is code review?

Code review one person reading over another's code and offering comments, suggestions, and feedback about how it could be improved. Often this is done at companies or in open source projects as a required step before proposed changes can be merged into a

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@bric3
bric3 / UTF-8-demo.txt
Last active March 10, 2021 08:14
Shell (commands) tips accumulated over years
UTF-8 encoded sample plain-text file
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25 CC BY
The ASCII compatible UTF-8 encoding used in this plain-text file
is defined in Unicode, ISO 10646-1, and RFC 2279.
@ionelmc
ionelmc / .gitignore
Last active February 12, 2020 09:26
A JSON parser benchmark. See README.rst for instructions.
*.cbor
*.log
*.xml
*.yaml
*.json
*.msgpack
*.html
*.marshal
*.pickle
.tox
@pmuellr
pmuellr / nsolid-install.sh
Last active January 31, 2021 13:19
sample script to install N|Solid components into ~/nsolid
#!/bin/bash
#-------------------------------------------------------------------------------
# download/unpack componentry for N|Solid into ~/nsolid
#-------------------------------------------------------------------------------
# updates:
# 2016-05-04 print note about officially supported "Download All" tarball
# 2016-02-10 change to get N|Solid versions dynamically from index.tab
# 2016-02-10 upgrade to N|Solid 1.2.1
# 2016-01-12 upgrade to N|Solid 1.2.0
@msysyamamoto
msysyamamoto / lib-hello_phoenix-memcached_supervisor.ex
Created September 1, 2015 15:13
Poolboy Sample on Phoenix Framework
defmodule HelloPhoenix.Memcached.Supervisor do
use Supervisor
def start_link do
Supervisor.start_link(__MODULE__, [])
end
def init([]) do
pool_options = [
name: {:local, :memcached_pool},
@therealklanni
therealklanni / y-memo.js
Last active October 2, 2016 22:37
Memoized Y-Combinator in ES6
let Ym = (f, s = JSON.stringify) => (g => g(g))(x => f((...v) => (k => k in x ? x[k] : x[k] = x(x)(...v))(s(v))))
let fib = Ym(f => n => n <= 1 ? n : f(n - 1) + f(n - 2))
console.log('fib(1000)', fib(1000)) // => 4.346655768693743e+208
@rom1504
rom1504 / gitStats.sh
Last active August 29, 2015 14:21
git stats
if [[ $# -ne 2 ]]
then
echo "usage : $0 <outputFile> <repo>"
exit 1
fi
outputFile=$1
repo=$2
rm $outputFile
cd $repo
git checkout master