Skip to content

Instantly share code, notes, and snippets.

View fourjuaneight's full-sized avatar
🤖

Juan Villela fourjuaneight

🤖
View GitHub Profile
@madrobby
madrobby / annotated.js
Created May 17, 2011 12:44 — forked from 140bytes/LICENSE.txt
Unit testing
function(
a, // a object holding test functions
b, // a logging function, taking multiple arguments
c, // placeholder
d, // placeholder
e, // placeholder
f // placeholder
){
c = d = e = 0; // initialize asserts, failures and exception counts to 0
for ( // iterate
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@mherb
mherb / safari_cache_clean.scpt
Created September 30, 2012 17:46
Apple Script to clean Safari Cache, History, Webpage Previews, Local Storage and Databases
-- Can be executed from Terminal using "osascript safari_cache_clean.scpt"
-- inspired by http://www.macuser.de/forum/f30/safari-alle-cache-544226/
set appname to "Safari"
if appIsRunning(appname) then
set started to true
-- Quit App
tell application appname to quit
else
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@basham
basham / css-units-best-practices.md
Last active April 29, 2024 10:40
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@viticci
viticci / Combine 3.py
Created November 18, 2014 14:37
Combine 3.py
import Image
import photos
import console
import ImageOps
# Pick screenshots to combine
screenshot1 = photos.pick_image(show_albums=True)
screenshot2 = photos.pick_image(show_albums=True)
screenshot3 = photos.pick_image(show_albums=True)
@codeinthehole
codeinthehole / osx_bootstrap.sh
Last active April 28, 2024 15:26
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@viticci
viticci / Selection.py
Created November 24, 2015 03:15
Selection.py
# coding: utf-8
import sys
import html2text
import clipboard
import webbrowser
webpage = clipboard.get()
text = sys.argv[1]
@steventroughtonsmith
steventroughtonsmith / main.m
Created March 24, 2016 08:08
Load Mach-O executable at runtime and execute its entry point
void callEntryPointOfImage(char *path, int argc, char **argv)
{
void *handle;
int (*binary_main)(int binary_argc, char **binary_argv);
char *error;
int err = 0;
printf("Loading %s…\n", path);
handle = dlopen (path, RTLD_LAZY);
// Vanilla version of FitVids
// Still licencened under WTFPL
//
// Not as robust and fault tolerant as the jQuery version.
// It's BYOCSS.
// And also, I don't support this at all whatsoever.
;(function(window, document, undefined) {
'use strict';