Skip to content

Instantly share code, notes, and snippets.

Avatar

Lucas Paulger lpaulger

View GitHub Profile
@alexdiliberto
alexdiliberto / .eslintrc.js
Last active Jan 26, 2021
Integrate Prettier with Ember
View .eslintrc.js
/*
'plugin:prettier/recommended' does the following:
extends: ['prettier'],
plugins: ['prettier'],
rules: {
'prettier/prettier': 'error'
}
*/
module.exports = {
@wiledal
wiledal / template-literals-3-for-loops.js
Last active Mar 26, 2021
Template Literals example: For loops
View template-literals-3-for-loops.js
/*
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) => `
@tlvince
tlvince / README.md
Created Nov 21, 2014
Quick and dirty Yeoman-Travis-Heroku deployment for static apps
View README.md
  1. Add [grunt-build-control][] to your app:

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

    buildcontrol: {
@traviskaufman
traviskaufman / jasmine-this-vars.md
Last active Jul 19, 2021
Better Jasmine Tests With `this`
View jasmine-this-vars.md

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() {
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active Sep 21, 2021
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

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:

@abourget
abourget / directives.js
Created Aug 8, 2012
Hammer.js integration with AngularJS
View directives.js
/**
* 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:
*
@tobytailor
tobytailor / get_barcode_from_image.js
Created Jun 1, 2010
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
View get_barcode_from_image.js
/*
* 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',