Skip to content

Instantly share code, notes, and snippets.

View jedfoster's full-sized avatar

Jed Foster jedfoster

View GitHub Profile

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

@jedfoster
jedfoster / enableVNC.sh
Created November 29, 2012 17:04 — forked from tiernano/enableVNC.sh
Enable VNC on OSX though the command line
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw mypasswd -restart -agent -privs -all
@jedfoster
jedfoster / disableVNC.sh
Created November 29, 2012 17:04 — forked from tiernano/disableVNC.sh
Disable VNC on OSX though Command Line
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off
@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 / 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 / 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.
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 / 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
#
@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 |
/*
A Revised Font Stack
from A Way Back
http://www.awayback.com/revised-font-stack/
*/
/*