Skip to content

Instantly share code, notes, and snippets.


Machisté N. Quintana mnquintana

View GitHub Profile
IanColdwater / twittermute.txt
Last active Sep 3, 2021
Here are some terms to mute on Twitter to clean your timeline up a bit.
View twittermute.txt
Mute these words in your settings here:
jnicklas /
Last active Oct 14, 2015
Why do .env files exist?

Why do .env files exist?

Lately I've seen a lot of projects use .env files to store application configuration, files which look something like this:

paulirish /
Last active Sep 19, 2021
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
samselikoff /
Last active Sep 13, 2021
Future-proofing your Ember 1.x code

This post is also on my blog, since Gist doesn't support @ notifications.

Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
robballou / someModule.js
Created Oct 29, 2014
Testing jQuery code in Mocha
View someModule.js
// The hacky bit of this approach is that this module uses
// jQuery, but it is not referenced here. This is because I
// am populating it in the test via global namespace.
// In the browser this still works because I am adding jQuery
// via a Browserify transform (browserify-global-shim).
function someModule() {
modules.export = someModule;
mlynch /
Last active Dec 6, 2020


Undo/Redo is one of those features of an application that you almost always need to have if you are building serious GUI tools for people to do work.

The best way to look at undo/redo is two stacks of operations the user has performed:

  • The Undo stack is the "history" of what they've done
  • The redo stack is the breadcrumbs back to the initial state before they started undoing
andrewxhill /
Last active Sep 18, 2020
How to fully customize infowindows in CartoDB

Advanced Infowindow Design

Getting Started

In this section, we will show you the advanced methods for controlling infowindows styles using the CartoDB interface. These skills will allow you to have highly customized infowindows for your published maps, created directly on your account. You don't need any programming skills to edit infowindows and you can see a tutorial of basic methods here. This section is about advanced methods and you will be required to use basic skills in HTML and later CSS.

Editing Infowindow HTML

CartoDB gives you direct access to the HTML that controls the layout of your infowindows. If you don't feel ready to edit HTML and CSS see the tutorial of basic methods. In CartoDB you can find the advanced editor by selecting the Infowindow Wizard and then clicking the small code tag in the upper right.

plapier / js2coffeescript.rb
Last active Dec 14, 2015
Convert Javascript to CoffeeScript (vice versa) directly from vim. Uses js2coffee library.
View js2coffeescript.rb
#!/usr/bin/env ruby
require 'tempfile'
file =['js2coffee', '.js'])
file.write # write vim selection to tmp file
puts `js2coffee #{file.path}` # requires js2coffee
file.unlink # deletes the temp file
dergachev /
Last active Sep 18, 2021
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


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

lancejpollard /
Created Nov 28, 2011
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin