Skip to content

Instantly share code, notes, and snippets.

View jmwhittaker's full-sized avatar

James Whittaker jmwhittaker

View GitHub Profile
@jmwhittaker
jmwhittaker / gruntfile.js
Created February 11, 2014 10:44
Simple grunt script for working with Framer.js locally.
module.exports = function (grunt) {
"use strict";
// Config...
grunt.initConfig({
watch: {
options: {
livereload: true
},
html: {
@jmwhittaker
jmwhittaker / gist:8516514
Last active May 2, 2024 03:16
Use FFmpeg to resize and generate .mp4 & .webm videos from any source video.
/**
Scaling
- Scale can be used as is which will set the height to 560 but keep aspect ratio for width.
- Other options include setting both with & height
- Watch out for sizing errors when not divisible by 2
**/
/** MP4 1st pass **/
ffmpeg -i input.mov -vcodec libx264 -vprofile high -preset veryslow -b:v 225k -maxrate 300k -bufsize 1000k -vf scale=-1:560 -threads 2 -pass 1 -an -f mp4 /dev/null
.ghx-avatar .ghx-avatar-img {
width:42px;
height: 42px;
border-radius:2px;
}
.ghx-avatar {
position: absolute;
top: 5px;
right: 5px;
@jmwhittaker
jmwhittaker / dabblet.css
Created August 9, 2013 12:41
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
button {
background:#ccc;
border:1px solid #bbb;
font-size:30px;
padding:10px;
.with-border {
border:1px solid #333;
}
.media-small {
width:145px;
height:97px;
background-position:50% 50%;
background-repeat:no-repeat;
display:block;
.with-border {
border:1px solid #333;
}
.media-small {
width:145px;
height:97px;
background-position:50% 50%;
background-repeat:no-repeat;
display:block;
@jmwhittaker
jmwhittaker / dabblet.css
Last active December 18, 2015 07:48
The Media Object
/**
* The Media Object
*/
.media {margin:10px;}
.media, .bd {overflow:hidden; _overflow:visible; zoom:1;}
.media .img {float:left; margin-right: 10px;}
.media .img img{display:block;}
/* for element positioned on the right */
.media .imgExt{float:right; margin-left: 10px;}
#!/bin/bash
#
# This script backups an OS X system to an external volume, effectively
# cloning it. It is based on [0], [1] and [2] for OS X and [3] and [4] for
# Linux. One could also use commercial tools like SuperDuper! or Carbon Copy
# Cloner. The latter website has an interesting list[5] on what files to
# exclude when cloning.
#
# Exclusions (from CCC[5]), see rsync_excludes_osx.txt
#
// We all know how to use mixins, right?
@mixin kung {
background: green;
color: yellow;
}
@mixin foo {
background: orange;
color: red;
@jmwhittaker
jmwhittaker / app.js
Last active November 26, 2021 16:15
Standard compliant stylesheet switcher for HTML5. Works on iOS5 and all modern browsers.
$(document).ready(function()
{
/* Check to see if we have saved a style already, a bit verbose but you get the drift! */
var theme = localStorage.getItem('style');
if (!theme) {
localStorage.setItem('style', 'light');
};
updateTheme();