Skip to content

Instantly share code, notes, and snippets.

View jedfoster's full-sized avatar

Jed Foster jedfoster

View GitHub Profile
<theme>
<!-- Window Style -->
<color id="foreground" red="1.0" green="0.776" blue="0.427" alpha="1.0" />
<color id="background" red="0.255" green="0.255" blue="0.255" alpha="1.0" />
<window foregroundColorID="foreground" backgroundColorID="background" shouldUseHUDScrollers="no" />
<!-- Text View Style -->
<color id="tag" red="0.800" green="0.471" blue="0.200" alpha="1.0" />
<color id="handle" extendsColorID="foreground" />
<color id="insertionPoint" red="1.0" green="1.0" blue="1.0" alpha="1.0" />
@jedfoster
jedfoster / appify
Created May 19, 2011 15:51 — forked from subtleGradient/appify
appify. Create the simplest possible mac app from a shell script
#!/usr/bin/env bash
#
# url : https://gist.github.com/672684
# version : 2.0.2
# name : appify
# description : Create the simplest possible mac app from a shell script.
# usage : cat my-script.sh | appify MyApp
# platform : Mac OS X
# author : Thomas Aylott <oblivious@subtlegradient.com>
/*
A Revised Font Stack
from A Way Back
http://www.awayback.com/revised-font-stack/
*/
/*
@jedfoster
jedfoster / typogridphy-2.css
Created November 18, 2011 19:34 — forked from LeeRJohnson/typogridphy-2.css
TYPOGRIDPHY - TYPOGRAPHICAL AND GRID LAYOUT CSS FRAMEWORK FROM HARRY ROBERTS OF CSS WIZARDRY
/*
+----------------------------------------------------------------------------------------------------+
| |
| TYPOGRIDPHY - TYPOGRAPHICAL AND GRID LAYOUT CSS FRAMEWORK FROM HARRY ROBERTS OF CSS WIZARDRY |
| |
+-------------------------------------------------+--------------------------------------------------+
| | |
| TYPOGRIDPHY IS © COPYRIGHT OF HARRY ROBERTS | v 0.2.0 |
| IT IS FREE TO BE USED AND MODIFIED PROVIDED | May 2009 |
@jedfoster
jedfoster / hack.sh
Created March 31, 2012 14:25 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
require 'fileutils'
class Jekyll < Thor
include FileUtils
method_options :format => :optional
def draft(name)
format = options[:format] || "markdown"
slug = name.downcase.gsub(/ +/,'-').gsub(/[^-\w]/,'').sub(/-+$/,'')
filename = slug + ".#{format}"
@jedfoster
jedfoster / twiterbs_image_helper
Created April 28, 2012 04:24 — forked from fredgrott/twiterbs_image_helper
twitterbs_image_helper
{% comment%}<!--
Be careful we do not want to access or iterate an array as an associative
array of associative arrays
We are cheating here by using
assign siteImgArrayObject to tell us what associative array to iterate over
out of collection of associative arrays.
@jedfoster
jedfoster / RWD Screen Width Indicator (em version)
Created July 19, 2012 16:25 — forked from jordanmoore/RWD Screen Width Indicator (em version)
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>
@jedfoster
jedfoster / javascript.js
Created October 12, 2012 19:47
Textarea selection and caret manipulation with Javascript
HTMLTextAreaElement.prototype.getCaretPosition = function () { //return the caret position of the textarea
return this.selectionStart;
};
HTMLTextAreaElement.prototype.setCaretPosition = function (position) { //change the caret position of the textarea
this.selectionStart = position;
this.selectionEnd = position;
this.focus();
};
HTMLTextAreaElement.prototype.hasSelection = function () { //if the textarea has selection then return true
if (this.selectionStart == this.selectionEnd) {
@jedfoster
jedfoster / unbomb.thor
Created October 24, 2012 17:56
Thor task to remove BOM from UTF-8 files
# Remove BOM from UTF-8 file
def unbomb(file)
string = File.open(file, 'r:utf-8').read().encode!('utf-8')
if string.start_with?("\uFEFF")
string.sub!(/\uFEFF/, '') # Remove the BOM
create_file file, string, {:force => true, :verbose => false}
end
end