Skip to content

Instantly share code, notes, and snippets.

View coffeesam's full-sized avatar
:octocat:
GitHubbing..

Sam Hon coffeesam

:octocat:
GitHubbing..
View GitHub Profile
@-moz-document domain("trello.com") {
/**
* Stylish CSS Chrome Extension: https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en
* Trello Card Numbers Chrome Extension: https://chrome.google.com/webstore/detail/trello-card-numbers/kadpkdielickimifpinkknemjdipghaf?hl=en
* Github for this gist: https://gist.github.com/coffeesam/3e3152197655c98f10ac
*
* Hiding card numbers for non user story boards
* ---------------------------------------------
* Usage: To hide card # just name your board __without__ ending with inception, iteration or sprint (case insensitive).
* Installation: Visit https://trello.com/ click on Stylish > write style for > import. Paste the contents of this gist, click Overwrite style.
@coffeesam
coffeesam / example.bash
Created November 16, 2015 10:03 — forked from choonkeat/html2sprockets.rake
`html2sprockets:assets` is a quick way to add 3rd-party js/css to your rails app that is asset pipeline compatible; creates local gem in `vendor/gems` and apply them in your `Gemfile`
# download and unzip https://github.com/hakimel/reveal.js/archive/3.1.0.zip
rake html2sprockets:assets NAME=revealjs SRC="/Users/choonkeat/Downloads/reveal.js-3.1.0/css
/Users/choonkeat/Downloads/reveal.js-3.1.0/js
/Users/choonkeat/Downloads/reveal.js-3.1.0/lib
/Users/choonkeat/Downloads/reveal.js-3.1.0/plugin"
# app/assets/stylesheets/reveal.css:/*
# app/assets/stylesheets/reveal.css: *= require revealjs/css/reveal.css
# app/assets/stylesheets/reveal.css: *= require revealjs/css/theme/black.css
# app/assets/stylesheets/reveal.css: *= require revealjs/lib/css/zenburn.css
# app/assets/stylesheets/reveal.css: */
#!/bin/sh
DOMAIN=`echo $1 | sed 's/https:\/\///' | sed -E 's/\/.*$//'`
URL="https://$DOMAIN"
if [ -z $URL ]; then
cat << EOF
Usage: ckrootca <url>
EOF
else
curl -c $DOMAIN.cookie -I -vs $URL 2>&1 | grep "Server certificate" -B1 | tail -n1
@coffeesam
coffeesam / yosemite_foomatic_paths.command
Created May 5, 2015 10:06
Yosemite Postscript driver sandbox lifting script
#!/bin/bash
######################################################################
#
# Product name: Foomatic PPD modifier for Yosemite
# version: 1.1 2014-10-28
#
# Copyright 2014 Matt Broughton <walterwego@macosx.com>
#
# This program is freed software; you can redistribute it and/or modify it
@coffeesam
coffeesam / bootstrap-progress-animation.scss
Last active October 2, 2019 21:09
Bootstrap progress animating stripes for all HTML elements
@-webkit-keyframes u-progress-stripes {
from { background-position: 0 0 }
to { background-position: 40px 0 }
}
@-moz-keyframes u-progress-stripes {
from { background-position: 0 0 }
to { background-position: 40px 0 }
}
@keyframes u-progress-stripes {
from { background-position: 0 0 }
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@coffeesam
coffeesam / ssh_copy_id.sh
Created January 14, 2014 09:06
SSH Key Install
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
ID_FILE="${HOME}/.ssh/id_rsa.pub"
if [ "-i" = "$1" ]; then
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-09
#
# _______________| netspeed : check download speed via command line.
#
# Usage: netspeed [tokyo, london, usw, use, east, west, URL]
# ^default U.S. west coast.
# [ -speed_KB/sec ]
# ^negation activates the Mbps converter.
#

Archive a GitHub Repository

git clone --bare git@github.com:jonlong/<repo>.git
tar -czf <repo>.git.tar.gz <repo>.git

Deploy an Archived Repository to GitHub

Create a new private repository on the target account:

curl -F 'login=' -F 'token=' -F 'name=jonlong/' -F 'public=0' http://github.com/api/v2/json/repos/create

@coffeesam
coffeesam / config
Created August 10, 2013 19:51 — forked from jessearmand/config
# SSH Connection pooling for faster additional connections to a machine
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
# This makes subsequent connections go faster
ControlPersist 2h
# Make it so ssh-ing from one server to another passes keys around automagically
Host *
ForwardAgent yes