Skip to content

Instantly share code, notes, and snippets.

View lpaulger's full-sized avatar

Lucas Paulger lpaulger

View GitHub Profile
@tobitailor
tobitailor / get_barcode_from_image.js
Created June 1, 2010 19:33
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
@abourget
abourget / directives.js
Created August 8, 2012 20:24
Hammer.js integration with AngularJS
/**
* Inspired by AngularJS' implementation of "click dblclick mousedown..."
*
* This ties in the Hammer events to attributes like:
*
* hm-tap="add_something()"
* hm-swipe="remove_something()"
*
* and also has support for Hammer options with:
*
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active March 20, 2024 18:46
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@traviskaufman
traviskaufman / jasmine-this-vars.md
Last active September 19, 2022 14:35
Better Jasmine Tests With `this`

Better Jasmine Tests With this

On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this object, and we've seen some awesome benefits from doing such.

The old way

Up until recently, a typical unit test for us looked something like this:

describe('views.Card', function() {
@tlvince
tlvince / README.md
Created November 21, 2014 19:13
Quick and dirty Yeoman-Travis-Heroku deployment for static apps
  1. Add [grunt-build-control][] to your app:

    npm install --save grunt-build-control
  2. Append its Grunt task:

    buildcontrol: {
@wiledal
wiledal / template-literals-3-for-loops.js
Last active March 13, 2023 22:47
Template Literals example: For loops
/*
Template literals for-loop example
Using `Array(5).join(0).split(0)`, we create an empty array
with 5 items which we can iterate through using `.map()`
*/
var element = document.createElement('div')
element.innerHTML = `
<h1>This element is looping</h1>
${Array(5).join(0).split(0).map((item, i) => `
@alexdiliberto
alexdiliberto / .eslintrc.js
Last active August 31, 2022 23:20
Integrate Prettier with Ember
/*
'plugin:prettier/recommended' does the following:
extends: ['prettier'],
plugins: ['prettier'],
rules: {
'prettier/prettier': 'error'
}
*/
module.exports = {