Skip to content

Instantly share code, notes, and snippets.

View wesbos's full-sized avatar
🔥
SLAYING BUGS

Wes Bos wesbos

🔥
SLAYING BUGS
View GitHub Profile
@wesbos
wesbos / gist:1885495
Created February 22, 2012 15:16
Facebook add application to a page 2012
Keep losing this snippet and facebook has taken away the buttons to do this so you must craft your own link
http://facebook.com/add.php?api_key=YOUR_APP_KEY&pages=1&page=YOUR_PAGE_ID
@wesbos
wesbos / gist:3744393
Created September 18, 2012 17:15
Use latest version of jquery in wordpress
/* pop me into your functions.php */
wp_deregister_script('jquery');
wp_register_script('jquery', ("http://code.jquery.com/jquery-git.js"), false, '1.8.2');
wp_enqueue_script('jquery');
@wesbos
wesbos / normalize.css
Created October 26, 2012 00:04
Normalize CSS compressed
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden]{display:none;}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:700;}dfn{font-style:italic;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace, serif;font-size:1em;}pre{white-space:pre-wrap;word-wrap:break-word;}q{quotes:\201C \201D \2018 \2019;}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-.5em;}sub{bottom:-.25em;}img{border:0;}svg:not(:root){overflow:hidden;}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,html input[type=button],/* 1
var sys = require('sys')
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { sys.puts(stdout) }
exec("git pull", puts);
// put this in your /Packages/User/Preferences.sublime-settings
// if this isn't being recognized in all languages, check to see if you have /packages/User/[langauge].sublime-settings is overriding anything as those files take precedence over user settings
"tab_size": 4,
"translate_tabs_to_spaces": false,
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden]{display:none;}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:700;}dfn{font-style:italic;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace, serif;font-size:1em;}pre{white-space:pre-wrap;word-wrap:break-word;}q{quotes:\201C \201D \2018 \2019;}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-.5em;}sub{bottom:-.25em;}img{border:0;}svg:not(:root){overflow:hidden;}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,html input[type=button],/* 1
$scope.edit = function(file) {
var file = JSON.parse(file),
path = file.links[0].url,
session;
// check if new session needs to be created
if(!!$scope.openEditors[path]) {
session = $scope.openEditors[path];
$scope.currentFile = file;
openSession(session);
JSON::ParserError - 795: unexpected token at 'WARNING: Missing required dependency to activate optional built-in extension coffeescripttransform.rb
cannot load such file -- coffee-script
{"/CNAME":"/CNAME","/docs/asciidoc-quick-reference.adoc":"/docs/asciidoc-quick-reference/index.html","/docs/asciidoc-quick-reference.pdf":"/docs/asciidoc-quick-reference.pdf","/docs/asciidoc-recommended-practices.adoc":"/docs/asciidoc-recommended-practices/index.html","/docs/asciidoc-syntax-quick-reference.redirect":"/docs/asciidoc-syntax-quick-reference.html","/docs/asciidoc-writers-guide.adoc":"/docs/asciidoc-writers-guide/index.html","/docs/editing-asciidoc-with-live-preview.adoc":"/docs/editing-asciidoc-with-live-preview/index.html","/docs/hack-asciidoctor-maven-plugin.adoc":"/docs/hack-asciidoctor-maven-plugin/index.html","/docs/index.adoc":"/docs/index.html","/docs/install-and-use-asciidoclet.adoc":"/docs/install-and-use-asciidoclet/index.html","/docs/install-and-use-asciidoctor-gradle-plugin.adoc":"/docs/install-and-
// Why do we use:
Math.floor(Math.random() * 6) + 1;
// vs
Math.ceil(Math.random() * 6);
@wesbos
wesbos / bh_core.sublime-settings
Created July 4, 2014 19:23
Bracket Highlighter User settings for Cobalt2
{
// Define region highlight styles
"bracket_styles": {
"default": {
"icon": "dot",
"color": "brackethighlighter.default",
"style": "underline"
},
"unmatched": {
"icon": "question",