This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
module.exports = function(grunt) { | |
function noop() {} | |
grunt.initConfig({ | |
watch: { | |
reload: { | |
files: ['public/**', 'views/**'], | |
tasks: 'reload' | |
} | |
}, |
The spec has moved to a repo: https://github.com/defunctzombie/package-browser-field-spec to facilitate collaboration.
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
app.filter('bytes', function() { | |
return function(bytes, precision) { | |
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-'; | |
if (typeof precision === 'undefined') precision = 1; | |
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'], | |
number = Math.floor(Math.log(bytes) / Math.log(1024)); | |
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number]; | |
} | |
}); |
package main | |
import ( | |
"fmt" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
"time" | |
) | |
type Person struct { |
// Implement bash string escaping. | |
var safePattern = /^[a-z0-9_\/\-.,?:@#%^+=\[\]]*$/i; | |
var safeishPattern = /^[a-z0-9_\/\-.,?:@#%^+=\[\]{}|&()<>; *']*$/i; | |
function bashEscape(arg) { | |
// These don't need quoting | |
if (safePattern.test(arg)) return arg; | |
// These are fine wrapped in double quotes using weak escaping. | |
if (safeishPattern.test(arg)) return '"' + arg + '"'; |
<!doctype html> | |
<html> | |
<head> | |
<title>placehold.js</title> | |
<script> | |
/* | |
Dynamically create a canvas to be used as an image placeholder. | |
If you really want an <img>, you can use: | |
var dataURL = canvas.toDataURL("image/png"); |
{ | |
// Settings | |
"passfail" : false, // Stop on first error. | |
"maxerr" : 10000, // Maximum error before stopping. | |
// Predefined globals whom JSHint will ignore. | |
"browser" : true, // Standard browser globals e.g. `window`, `document`. | |
"node" : false, |
#!/usr/bin/python | |
# | |
# git-slim | |
# | |
# Remove big files from git repo history. | |
# | |
# Requires GitPython (https://github.com/gitpython-developers/GitPython) | |
# | |
# References: | |
# - http://help.github.com/remove-sensitive-data/ |