Skip to content

Instantly share code, notes, and snippets.

View timdream's full-sized avatar
🏃‍♂️
I may be slow to respond.

Timothy Guan-tin Chien timdream

🏃‍♂️
I may be slow to respond.
View GitHub Profile
@teramako
teramako / personas.js
Created March 7, 2010 09:53
personas.js - Vimperator Plugin
// Vimperator plugin for personas
/*
Command:
:personas {id}
change to {id}'s theme
:personas null
use default theme
:personas {id} -c[color] {color}
@mtigas
mtigas / gist:952344
Last active June 15, 2026 22:12
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@n1k0
n1k0 / gist:1501173
Created December 20, 2011 10:44 — forked from fbuchinger/gist:1501115
PhantomJS: Capturing single dom elements as png files
var page = new WebPage(),
address, output, size;
//capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs
capture = function(targetFile, clipRect) {
var previousClipRect;
var clipRect = {top: 0, left:0, width: 40, height: 40};
if (clipRect) {
if (!isType(clipRect, "object")) {
throw new Error("clipRect must be an Object instance.");
@timdream
timdream / pullme.php
Last active October 2, 2015 21:38
Minimuist pull me script that work with Github hook
<?php
/* host machine settings */
$GIT_BIN = '/usr/local/bin/git';
$LOCAL_USER = 'www';
/* remote repo settings */
$REMOTE = 'origin';
$BRANCH = 'production';
@wilsonpage
wilsonpage / umd-module.js
Last active August 19, 2016 13:18
UMD (amd, common.js, window)
;(function(define){define(function(require,exports,module){
//...
});})(typeof define=='function'&&define.amd?define
:(function(n,w){'use strict';return typeof module=='object'?function(c){
c(require,exports,module);}:function(c){var m={exports:{}};c(function(n){
return w[n];},m.exports,m);w[n]=m.exports;};})('module-name',this));
@mnjul
mnjul / pull.sh
Last active August 29, 2015 14:04
Pull & Extract / Pack & Push omni.ja from/to FxOS phone
adb pull /system/b2g/omni.ja
rm -rf omni.old
mv omni omni.old
mkdir omni
mv omni.ja omni
cd omni
unzip omni.ja
rm omni.ja
cd ..
@rickychien
rickychien / push-to-try.sh
Last active August 29, 2015 14:11
Push to mozilla try server (Usage: ./push-to-try.sh branch-name)
#!/bin/bash
# setup your mozilla-central REPO and github REMOTE.
# path to mozilla-central
REPO="mozilla-central"
# regualr expression for gaia github repo url
REMOTE="https:\/\/github\.com\/RickyChien\/gaia"
@Belphemur
Belphemur / bridge-conf
Last active January 29, 2024 11:45
Configuration and scripts for OpenVPN in Bridged Mode. Script to generate new client (with their keys and configuration file for OpenVPN). Script to manage the bridge. Configuration for systemd to start/stop the OpenVPN with Brige.
#!/bin/bash
# Define physical ethernet interface to be bridged
# with TAP interface(s) above.
eth="eth0"
eth_ip="192.168.42.2"
eth_netmask="255.255.255.0"
eth_broadcast="192.168.42.255"
eth_gateway="192.168.42.1"
eth_mac="XX:XX:XX:XX:XX:XX"
@paulirish
paulirish / what-forces-layout.md
Last active July 18, 2026 01:45
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent