Skip to content

Instantly share code, notes, and snippets.

View michaelcpuckett's full-sized avatar

Michael Puckett michaelcpuckett

View GitHub Profile
<!--<div>Really since structure matters so much it almost makes sense to do everything exactly as a lifeless div. it will be a lot more repeated styles, but reset everything to ... and just make it well structured (and theorhetially seo friendly) with sectioning tags and h1s and form elements
<div>Rewrite to make functional and reactive</div>
<div>It would be nice to have the markup show up right above the html you write
and automatically update...
especially if it's BEM! :D
and from a mustache template
or really just view the contents of any file anywhere in sublime..
OR prefix class selectors with a commented out tag name
to encourage using only class names</div>-->
@michaelcpuckett
michaelcpuckett / jenkins-icon.js
Created February 6, 2014 17:34
Update Jenkins icon with most recent build status
var script = document.createElement('script');
script.src = 'https://raw2.github.com/dlom/favicon.js/master/favicon.min.js';
script.addEventListener('load', function () { favicon.change(document.querySelectorAll('#buildHistory .build-row img')[0].src); });
document.body.appendChild(script);
@michaelcpuckett
michaelcpuckett / app.js
Created January 7, 2014 22:26
Create a proxy server through Charles so local environment can be accessed via an iPhone etc
var request = require('request');
var http = require('http');
/* Constants */
var PORT = process.argv[2] || 8080,
DEV_SERVER_URL = process.argv[3] || 'http://dev.server.com';
/* OVERRIDE `http.require` TO GLOBALLY PROXY TO CHARLES */
/* NOTE: Charles must be running */
@michaelcpuckett
michaelcpuckett / quick-meganav.html
Created September 14, 2013 17:07
Quick meganav
<nav>
<ul>
<li>
<a href="/home">
Home
</a>
</li>
<li>
<a href="/news">
News
// string
typeof str === 'string'
// number
typeof num === 'number'
// undefined
typeof u === 'undefined'
// boolean
function getTimestamp (dateString) {
function getDate () {
var days = [],
months = [],
date = null;
days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat'];
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
date = new Date((dateString || "").replace(/-/g,"/").replace(/[TZ]/g," "));
function getMostFrequentWord (str) {
var i = 0,
arr = [],
counts = {},
mostCommonWords = [];
mostCommonCount = 0;
arr = str.replace(/[^a-z\s]/g, '')
.toLowerCase()
function getMostCommonWord (str) {
var i,
arr,
word,
words = {},
separator = 'X',
mostCommonWord;
arr = str.replace(/[^a-zA-Z0-9 -]/g, '') // remove all but letters and numbers
.toLowerCase()
@michaelcpuckett
michaelcpuckett / dabblet.css
Created April 26, 2013 13:26 — forked from LeaVerou/dabblet.css
SVG inspired by Quine's paradox
/**
* SVG inspired by Quine's paradox
*/
svg {
display: block;
margin: 40px auto;
font: 83px sans-serif;
}

Bash (Readline)

Moving

ctrl + a                 Goto BEGINNING of command line
ctrl + e                 Goto END of command line
ctrl + b                 move back one character
ctrl + f                 move forward one character

alt + f move cursor FORWARD one word