Skip to content

Instantly share code, notes, and snippets.

View jonchretien's full-sized avatar
📷

Jon C. jonchretien

📷
View GitHub Profile
@jonchretien
jonchretien / gist:1127727
Created August 5, 2011 15:06
New Project Bash Script
#!/bin/bash
# creates a new project template
# http://linuxdevcenter.com/pub/a/linux/lpt/18_15.html
# usage:
# $ ~/bin/project.sh projectname
# copy project directory
mkdir $1
@jonchretien
jonchretien / gitignore
Created August 17, 2011 20:34
What to leave out.
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@jonchretien
jonchretien / gist:3913820
Created October 18, 2012 18:07 — forked from paulirish/gist:3910471
page visibility API : tribulations with prefixes
// this is the least sucky way i could think of to
// detect and deal with a cross-browser impl of the page visibility api
// forks welcome.
function getHiddenProp(){
var prefixes = ['webkit','moz','ms','o'];
if ('hidden' in document) return 'hidden';
@jonchretien
jonchretien / fullScreenToggler.html
Last active October 13, 2015 05:57
Full Screen Toggler
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<style type="text/css" media="screen">
.shell:-moz-full-screen,
.shell:-webkit-full-screen {
width: 100% !important;
}
@jonchretien
jonchretien / regionParser.html
Last active October 13, 2015 23:07
Parser that extracts region names from data stream and pushes to sorted array.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Region Parser</title>
<meta charset="UTF-8">
</head>
<body>
<button id="js-button">Filter Data</button>
<ol id="js-container"></ol>
@jonchretien
jonchretien / index.html
Created November 5, 2015 16:19
Learning React
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Spotify Artist Search</title>
<link rel="stylesheet" type="text/css" href="https://developer.spotify.com/web-api/static/css/cached.css">
<style>
body {
padding: 20px;
}
@jonchretien
jonchretien / gist:4381572
Created December 26, 2012 17:13
CSS3 LESS Mixins
.text-shadow (@string: 0 1px 3px rgba(0, 0, 0, 0.25)) {
text-shadow: @string;
}
.box-shadow (@string) {
-webkit-box-shadow: @string;
-moz-box-shadow: @string;
box-shadow: @string;
}
.drop-shadow (@x: 0, @y: 1px, @blur: 2px, @spread: 0, @alpha: 0.25) {
-webkit-box-shadow: @x @y @blur @spread rgba(0, 0, 0, @alpha);
@jonchretien
jonchretien / rAF.js
Created January 2, 2013 18:54 — forked from paulirish/rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
(function() {
if ( typeof document.ontouchmove === 'object' || location.hash.indexOf('isTouch') > 0 ) {
window.addEventListener('load', function() {
setTimeout(function(){
window.scrollTo(0, 1);
}, 0);
});
}
})();
@jonchretien
jonchretien / gist:4565081
Created January 18, 2013 14:56
Sublime Text 2 Key Bindings (User)
[
{
// Code Formatting
// The argument allows the command to also work on the entire file in addition to a selection.
"keys": ["command+option+["],
"command": "reindent",
"args": {
"single_line": false
}
}