Skip to content

Instantly share code, notes, and snippets.

@agaviria
agaviria / Ledger_3_commands.dat
Created August 10, 2012 20:03
Collection of ledger-cli commands
# comments example for .dat or .ledger files
@smallexample
; This is a single line comment,
# and this,
% and this,
| and this,
* and this.
# If you have a deeply nested tree of accounts,
# it may be convenient to define an alias, for example:
@dylanvee
dylanvee / gist:3419976
Created August 21, 2012 22:22
imagemagick crop square
# This snippet does everything I've ever wanted out of imagemagick.
# Equivalent to cropping to min(width, height) by min(width, height) and resizing to N x N.
# See http://www.imagemagick.org/Usage/thumbnails/#cut
# If you're writing this in bash or zsh, don't forget to escape the ^ with a backslash
convert -resize 256x256^ -extent 256x256 in.png out.png
@francisbyrne
francisbyrne / chmodr.sh
Created September 16, 2012 07:54
Recursive chmod script for dirs and/or files
#!/bin/sh
#
# chmodr.sh
#
# author: Francis Byrne
# date: 2011/02/12
#
# Generic Script for recursively setting permissions for directories and files
# to defined or default permissions using chmod.
#
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@plasticbrain
plasticbrain / gist:3887245
Created October 14, 2012 04:00
PHP: mime types (array format)
<?php
$mime_types = array(
'.3dm' => 'x-world/x-3dmf',
'.3dmf' => 'x-world/x-3dmf',
'.a' => 'application/octet-stream',
'.aab' => 'application/x-authorware-bin',
'.aam' => 'application/x-authorware-map',
'.aas' => 'application/x-authorware-seg',
'.abc' => 'text/vnd.abc',
'.acgi' => 'text/html',
@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@ryankearney
ryankearney / ComcastInject.html
Last active June 10, 2023 14:40
This is the code Comcast is injecting into its users web traffic.
<script language="JavaScript" type="text/javascript">
// Comcast Cable Communications, LLC Proprietary. Copyright 2012.
// Intended use is to display browser notifications for critical and time sensitive alerts.
var SYS_URL='/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do';
// var image_url='http://servicealerts.comcast.net:8080/images/mt';
var image_url='http://xfinity.comcast.net/constantguard/BotAssistance/notice/images';
var headertext1='<strong>Comcast Courtesy Notice</strong>';
var textline1='You have reached 90% of your <b>monthly data usage allowance</b>.';
var textline2='Please sign in for more information and to remove this alert.';
var acknowledgebutton='<a href=\"#\" onClick="document.location.href=\''+SYS_URL+'?dispatch=redirect&redirectName=login&paramName=bmUid\'" title="Sign in to acknowledge" style="color: #FFFFFF;"><img alt="Sign in to acknowledge" src="'+image_url+'/mt_signin.png"/></a>';
@caruccio
caruccio / bash-path-vars
Last active December 28, 2023 22:47
Path manipulation with bash vars
$ FILE=/some/path/to/file.txt
###################################
### Remove matching suffix pattern
###################################
$ echo ${FILE%.*} # remove ext
/some/path/to/file
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts
@adamloving
adamloving / temporary-email-address-domains
Last active April 24, 2024 14:20
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: