Skip to content

Instantly share code, notes, and snippets.

View JonathanBeech's full-sized avatar

Jonathan Beech JonathanBeech

View GitHub Profile
@JonathanBeech
JonathanBeech / gist:3288664
Created August 7, 2012 19:31
HTML: Starting Template
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>$0</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/master.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
@JonathanBeech
JonathanBeech / css: Image Replacement
Created August 7, 2012 20:00
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@JonathanBeech
JonathanBeech / gist:3288881
Created August 7, 2012 20:05
Javascript: JQueryPubSub
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@JonathanBeech
JonathanBeech / gist:3288912
Created August 7, 2012 20:08 — forked from padolsey/gist:527683
Javascript: Detect ie
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@JonathanBeech
JonathanBeech / Side Bar.sublime-menu
Created August 17, 2012 06:40
Sublime Text: sidebar enhancement settings
[
{"id": "side-bar-files-open-with",
"children":
[
// Espresso
{
"caption": "Espresso",
"id": "side-bar-files-open-with-espresso",
@JonathanBeech
JonathanBeech / Default (OSX).sublime-keymap
Created August 20, 2012 08:12
Sublime Text: sublime keymap
[
{ "keys": ["ctrl+super+n"], "command": "new_snippet" },
{ "keys": ["super+shift+v"], "command": "paste" },
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["n", "n"], "command": "advanced_new_file",
"context": [{"key": "setting.command_mode", "operand": true}]},
{ "keys": ["j", "j"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
@JonathanBeech
JonathanBeech / custom-posts-helper.php
Created August 20, 2012 08:26 — forked from GreenGeorge/custom-posts-helper.php
Wordpress: Functions to quickly automate making custom post types in wordpress
<?php
// ***** Declare function that buids the post type
function add_post_type($name, $args = array() ) {
add_action('init',function() use($name, $args) {
// make post type name capitalized
$upper = ucwords($name);
// make name acceptable
@JonathanBeech
JonathanBeech / gist:3403282
Created August 20, 2012 11:12
Terminal: list of useful zsh alias's and functions
alias doc='cd ~/Documents'
alias desk='cd ~/Desktop'
alias ren='mv'
alias up='cd ..'
alias ..='cd ..'
alias ...='cd ../..'
alias ls='ls -F'
alias l='ls'

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@JonathanBeech
JonathanBeech / gist:3487834
Created August 27, 2012 11:57
css: simple reset
html,body,blockquote,code,h1,h2,h3,h4,h5,h6,p,pre{margin:0;padding:0}
button,fieldset,form,input,legend,textarea,select{margin:0;padding:0}
fieldset{border:0}
a,a *{cursor:pointer}
div{margin:0;padding:0;background-color:transparent;text-align:left}
hr,img{border:0}
applet,iframe,object{border:0;margin:0;padding:0}
button,input[type=button],input[type=image],input[type=reset],input[type=submit],label{cursor:pointer;}
ul,li{list-style:none;margin:0;padding:0;}
strong{font-weight:bold;}