Skip to content

Instantly share code, notes, and snippets.

View jsturgis's full-sized avatar

Jeff Sturgis jsturgis

View GitHub Profile
@jsturgis
jsturgis / css.css
Last active September 27, 2015 10:28
Pure css drop down menu
/* episode nav*/
.episode-nav-container{background:#2D2D2D;padding:15px 0;height:26px;}
.episode-nav-block{
position:absolute;
left: 50%;
margin-left: -80px;
}
.episode-selector:hover{
@jsturgis
jsturgis / canvas-clock.js
Last active December 14, 2015 17:29
Draw a clock to canvas and with support for HiDPI screens.
/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, undef:true, unused:true, curly:true, browser:true, jquery:true, indent:4, maxerr:50, maxparams:4, maxdepth:3, maxcomplexity:3, white: false */
/*global window: true*/
/* params: min=0-59 time offset, clock: node containing the clock, clockColor: color of the clock */
window.canvasClock = function ( min, clock, clockColor ) {
// setup clock
var canvas = clock.getElementsByTagName('canvas')[0],
c2d = canvas.getContext('2d'),
mins = 0,
hour = 0,
@jsturgis
jsturgis / wget download all linked files
Created August 13, 2013 18:40
Download all linked files with wget ignoring robots and waiting between files to limit load to server.
wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com
@jsturgis
jsturgis / git-aliases
Created April 11, 2014 19:59
git aliases
i = commit
cia = commit -a
cim = commit -m
ciam = commit -am
d = diff
dn = diff --no-ext-diff
dt = difftool
st = status
co = checkout
cp = cherry-pick
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.14.2/TweenMax.min.js"></script>
<div class="odometer-digit-container" data-offset="1" data-time="0.25">
<div class="odometer-digit-inner">
<div class="odometer-scroll-container">
<div class="odometer-scroll-digit"></div>
<div class="odometer-scroll-digit"></div>
<div class="odometer-scroll-digit"></div>
@jsturgis
jsturgis / text-blur.css
Last active August 29, 2015 14:11
blur text content with css
.blur .content {
color: transparent; /* hide text */
cursor: default;
text-shadow: 0 0 5px rgba(0,0,0,0.5); /* make text blurry */
opacity: 0.75; /* fade text slightly */
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@jsturgis
jsturgis / dynamic-elem-anim.js
Last active August 29, 2015 14:11
force browser redraw to allow css3 transitions on dynamically created elements
// just call this method after inserting the element
window.getComputedStyle(elem)[propName];
@jsturgis
jsturgis / dropbox.service.md
Last active June 24, 2022 09:30
ubuntu 15.04 dropbox systemd

Install Dropbox and python script, symlink python script to /usr/local/bin/dropbox and add to your path.

/etc/systemd/system/dropbox.service contents

[Unit]
Description=Dropbox Service
After=network.target

[Service]
ExecStart=/bin/sh -c '/usr/local/bin/dropbox start'
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Checkbox fun',
checked: false,
actions: {
check: function() {
this.toggleProperty('checked');
console.log('got check', this.get('checked'));