Skip to content

Instantly share code, notes, and snippets.

View nsbingham's full-sized avatar

Nathan Bingham nsbingham

  • optional
  • United States
View GitHub Profile
@trey
trey / hubot-slack-heroku.md
Last active October 25, 2021 03:18
Steps to Install Hubot in Slack using Heroku
@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active August 3, 2024 16:45
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin <branch-name>
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active March 12, 2025 04:26
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@chrism
chrism / utils.preload-images.js
Created May 26, 2015 15:21
Preloading images using Ember.JS util
import Ember from 'ember';
var Promise = Ember.RSVP.Promise;
export default function preloadImages(...urls) {
let promises = urls.map(url => {
return new Promise((resolve, reject) => {
let image = new Image();
image.onload = resolve;
image.onerror = reject;
image.src = url;
@lamchau
lamchau / ember-component-fadeout.js
Created August 17, 2015 19:53
`fadeIn` and `fadeOut` for Ember Component (ES6; ember-cli)
export default Ember.Component.extend({
fadeDurationInMilliseconds: 300,
didInsertElement() {
let duration = this.get("fadeDurationInMilliseconds"),
element = this.$();
element.fadeIn(duration);
},
@ttscoff
ttscoff / gifsicle.sh
Last active February 20, 2025 09:31
% brew install gifsicle
# modify colors as needed, it will warn you if you specify more than necessary
% gifsicle --colors 128 -O3 -o output.gif input.gif
@thorsten
thorsten / setUserAgent.js
Created May 9, 2016 15:12
Override user agent on all browsers
function setUserAgent(window, userAgent) {
// Works on Firefox, Chrome, Opera and IE9+
if (navigator.__defineGetter__) {
navigator.__defineGetter__('userAgent', function () {
return userAgent;
});
} else if (Object.defineProperty) {
Object.defineProperty(navigator, 'userAgent', {
get: function () {
return userAgent;
@patrickkunka
patrickkunka / configuration-1.js
Last active November 17, 2022 02:15
Configuration Patterns
/**
* Configuration #1: Basic Configuration Class
*
* A basic example utilising a sealed instance of a configuration
* class, with user-provided options merged in upon instantation
* of the implementation.
*/
class Config {
constructor() {
@Hyperparticle
Hyperparticle / config.yml
Last active November 9, 2021 09:29
CircleCI 2.0 Jekyll build and Firebase deploy
### Taken from https://github.com/Hyperparticle/hyperparticle.github.io/blob/2365749469b1eea3e8c4b18af24a4865fc426fd3/.circleci/config.yml
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
@rtpHarry
rtpHarry / animation.js
Last active September 11, 2024 02:25
Three.js - play an AnimationAction in reverse. There are a bunch of threads saying this isn't possible but I found a way so I wanted to post it online in a place that people will hopefully stumble upon it.
// The class itself is based on the animation helper class in
// https://github.com/paulmg/ThreeJS-Webpack-ES6-Boilerplate
// but I have changed almost everything except for the class name and the update function.
import * as THREE from 'three';
export default class Animation {
constructor(scene, animations) {
this.scene = scene;
this.animations = animations;