Skip to content

Instantly share code, notes, and snippets.

View asimpson's full-sized avatar

Adam Simpson asimpson

View GitHub Profile
@ttscoff
ttscoff / matrixish.sh
Created September 15, 2012 18:23
A Matrix-ish display for Bash terminal
#!/bin/bash
#
# matrix: matrix-ish display for Bash terminal
# Author: Brett Terpstra 2012 <http://brettterpstra.com>
# Contributors: Lauri Ranta and Carl <http://blog.carlsensei.com/>
#
# A morning project. Could have been better, but I'm learning when to stop.
### Customization:
blue="\033[0;34m"
@jackmcdade
jackmcdade / gist:3484008
Created August 26, 2012 22:44
Bash - archive to desktop
function zipit {
local filename=$1
if [ -z "$filename" ] ; then
filename=${PWD##*/}"-latest"
fi
git archive HEAD --format=zip > ~/Desktop/${filename}.zip
}
@nickawalsh
nickawalsh / _settings.sass
Created August 24, 2012 09:55
Style Debugging
%debug
background-color: pink !important
@marcedwards
marcedwards / high-dpi-media.css
Last active March 2, 2025 20:24
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@elijahmanor
elijahmanor / console.js
Created August 24, 2012 03:27
Custom JSBin Settings
jsbin.settings.editor.theme = "monokai";
jsbin.settings.editor.indentUnit = 4;
jsbin.settings.editor.smartIndent = true;
jsbin.settings.editor.tabSize = 4;
jsbin.settings.editor.indentWithTabs = true;
jsbin.settings.editor.autoClearEmptyLines = true;
jsbin.settings.editor.lineWrapping = true;
jsbin.settings.editor.lineNumbers = true;
jsbin.settings.editor.matchBrackets = true;
@gyrus
gyrus / gist:3155982
Created July 21, 2012 14:40
Rename WordPress "Posts" to "News"
<?php
/**
* Rename "Posts" to "News"
*
* @link http://new2wp.com/snippet/change-wordpress-posts-post-type-news/
*/
add_action( 'admin_menu', 'pilau_change_post_menu_label' );
add_action( 'init', 'pilau_change_post_object_label' );
function pilau_change_post_menu_label() {
@jordanmoore
jordanmoore / RWD Screen Width Indicator (em version)
Created July 19, 2012 14:05
Current screen width indicator in EMs (useful for knowing when to add breakpoints when resizing browser window)
<script>
$(window).resize(function() {
var windowWidth = $(window).width();
var bodyFontSize = $('body').css('font-size');
var bodyFontSizeWithoutPx = parseInt(bodyFontSize);
var emValue = windowWidth/bodyFontSizeWithoutPx;
$('.screen-width').text(emValue + 'em');
});
</script>
@jordanmoore
jordanmoore / RWD Screen Width Indicator
Created July 19, 2012 13:17
Current screen width indicator (useful for knowing when to add breakpoints when resizing browser window)
<script>
$(window).resize(function() {
var windowWidth = $(window).width();
$('.screen-width').text(windowWidth + 'px');
});
</script>
<div id="debug" style="position:fixed;padding:0.3em 0.6em;background:#f1f1f1;font-size:0.6em;bottom:0;left:50%;">
<span class="screen-width">0</span>
</div>
@funkatron
funkatron / public_facebook_feeds.txt
Created July 18, 2012 21:12
here's how you get public FB data feeds
This only works with fully public profiles – try accessing the profile while logged-out of Facebook first.
Start with the username for a user. Let's try "thestrokes", from <https://www.facebook.com/thestrokes>
Note that you have to provide a user agent; it doesn't like curl's default. Also use -L to follow redirects.
curl -L -A 'Firefox' https://graph.facebook.com/thestrokes
gives us this:
@markd2
markd2 / serial.m
Created May 14, 2012 15:06
Playing with NSPropertyListSerialization
#import <Foundation/Foundation.h>
// clang -g -Wall -fobjc-arc -framework Foundation -o serial serial.m
static id makePlistObjects (void) {
NSMutableDictionary *top = [NSMutableDictionary dictionary];
[top setObject: @"Hi I'm a string" forKey: @"string"];
[top setObject: [NSNumber numberWithInt: 23] forKey: @"number"];