Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cowboy
cowboy / Dockerfile
Created February 1, 2018 15:00 — forked from tasuten/Dockerfile
Building container for https://github.com/be5invis/Iosevka
FROM ubuntu
RUN apt-get update
RUN apt-get install -y build-essential curl
# NodeJS >= 6.0
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
# ttfautohint
@cowboy
cowboy / synth.cpp
Created September 14, 2017 12:55 — forked from genericpenguin/synth.cpp
Arduino Synth
/* Arduino Synth from
https://janostman.wordpress.com/2016/01/15/how-to-build-your-very-own-string-synth/
*/
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
@cowboy
cowboy / 0_reuse_code.js
Created November 30, 2015 15:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
mobile: function() {
return Modernizr.mq("only all and (max-width: 480px)");
}
@cowboy
cowboy / shebangs
Last active December 11, 2015 22:09 — forked from miketaylr/shebang
#!/ricky martin
@cowboy
cowboy / grunt-task-definition-options.js
Created September 17, 2012 15:37
task definitions
// inside a gruntfile
grunt.registerTask('awesome', {
description: 'The most awesome task ever.',
type: 'multi',
main: function(grunt, arg) {
var files = grunt.file.expandFiles(grunt.util._.pluck(this.files, 'src'));
var success = this.task.listFiles(grunt, files);
grunt.log.writeln('Stuff happened...');
if (success) { grunt.log.ok(); } else { grunt.log.error(); }
},
@cowboy
cowboy / gist:3086861
Created July 10, 2012 23:18 — forked from rmurphey/gist:3086328
What's wrong with Netmag's "Optimize your JavaScript" post

What's wrong with Netmag's "Optimize your JavaScript" post

I tweeted earlier that this should be retracted. Generally, these performance-related articles are essentially little more than linkbait -- there are perhaps an infinite number of things you should do to improve a page's performance before worrying about the purported perf hit of multiplication vs. division -- but this post went further than most in this genre: it offered patently inaccurate and misleading advice.

Here are a few examples, assembled by some people who actually know what they're talking about (largely Rick Waldron and Ben Alman, with some help from myself and several others from the place that shall be unnamed).

Things that are just plain wrong

  • Calling array.push() five times in a row will never be a "performance improvement." The author has clearly co
@cowboy
cowboy / self-assessment.md
Created May 23, 2012 17:49 — forked from rmurphey/self-assessment.md
Self-Assessment for Bocoup's "Foundations of Programming with JavaScript" Training

Self-Assessment for Bocoup's "Foundations of Programming with JavaScript" training

This gist is aimed at helping you assess whether you'll be a good fit for Bocoup's "Foundations of Programming with JavaScript" training. This class is aimed at introducing you to fundamental concepts of development using JavaScript. In this class, you'll work through the process of building a simple game of hangman; along the way, you'll learn about functions, arrays, objects, and prototypes, and get a brief introduction to the jQuery library. You'll also learn about approaches that will help you write more maintainable code, and get introduced to tools for debugging and testing your JavaScript.

@cowboy
cowboy / grunt.md
Created April 25, 2012 16:29 — forked from mikesherov/grunt.md
getting grunt to work on windows with cygwin and git

Getting grunt to work with Cygwin and git on Windows is a bit difficult considering the cygwin package that is installed by git has an outdated version of node running on it. There are several issues to work through:

  1. Cygwin by default installs an old version of node.
  2. Open Cygwin shell
  3. which node tells you where the executable is
  4. node --version tells you if it's old
  5. cd to the directory listed by which node
  6. mv node.exe node.exe.bak
  7. download node from nodejs.org and install it
  8. Node installed through installer doesn't update PATH to point to correct version of node installed normally.