Skip to content

Instantly share code, notes, and snippets.

@mengzhuo
mengzhuo / toggle-touchpad
Created October 30, 2013 05:38
Toggle TouchPad on Linux with synclient, works/Tested on Ubuntu
#!/bin/sh
synclient TouchpadOff=$((`synclient -l | grep TouchpadOff | awk '{print $3}'`==0))
@chriskjaer
chriskjaer / gulpfile.js
Last active November 1, 2017 08:22
Gulp recipe: Jade, Sass, Livereload and static server
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
csso = require('gulp-csso'),
uglify = require('gulp-uglify'),
jade = require('gulp-jade'),
concat = require('gulp-concat'),
livereload = require('gulp-livereload'), // Livereload plugin needed: https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
tinylr = require('tiny-lr'),
express = require('express'),
@laanwj
laanwj / urbit_sniffer.py
Created November 30, 2014 08:57
Urbit UDP sniffer
#!/usr/bin/python3
# Copyright (c) 2014 Wladimir J. van der Laan, Visucore
# Distributed under the MIT software license, see
# http://www.opensource.org/licenses/mit-license.php.
'''
urbit UDP sniffer
Usage: urbit_sniffer.py [-p <port1>-<port2>,<port3>,...] [-i <interface>]
'''
import socket, struct, sys, io, argparse
@nolanlawson
nolanlawson / rant.md
Last active March 1, 2023 23:34
Misconceptions about PouchDB

Misconceptions about PouchDB

A quick rant.

  1. PouchDB is slow, because it doesn't use bare-metal IndexedDB

OK, first off I want to point out the CanIUse table for IndexedDB. Go ahead, look at it. I'll wait.

@0XDE57
0XDE57 / config.md
Last active May 30, 2024 19:04
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@jart
jart / ordinary.c
Created December 28, 2015 16:38
Perfectly Ordinary C
/**//*
*//** This is perfectly ordinary C
**//*
*//** cc -std=c99 lol.c
**//* ./a.out justine 31
*//**/
#include <stdio.h>
#include <stdlib.h>
@maiermic
maiermic / variance.md
Last active September 26, 2023 16:07
Description of the four kinds of variance: covariance, contravariance, invariance and bivariance.

Variance

The term variance describes how subtyping between higher kinded types is related to subtyping relations of their type arguments.

Higher Kinded Types

A higher kinded type composes type arguments to a new type. I use square bracket notation to define a higher kinded type:

C[T] // The higher kinded type `C` composes type argument `T` to a new type `C[T]`.

The same works with multiple type arguments:

@MIvanchev
MIvanchev / article.md
Last active April 4, 2023 13:39
Ever wondered what it takes to run Windows software on ARM? Then this article might be for you!
@morajabi
morajabi / useRect.js
Created February 18, 2019 14:35
useRect — getBoundingClientRect() React Hook with resize handler
import { useLayoutEffect, useCallback, useState } from 'react'
export const useRect = (ref) => {
const [rect, setRect] = useState(getRect(ref ? ref.current : null))
const handleResize = useCallback(() => {
if (!ref.current) {
return
}