Skip to content

Instantly share code, notes, and snippets.

View gvn's full-sized avatar
🥀
technopagan is the term

Gavin Suntop gvn

🥀
technopagan is the term
View GitHub Profile
@gvn
gvn / freshmaker.sh
Created December 6, 2013 19:31
The Freshmaker
#!/bin/bash
rm -rf node_modules
rm -rf bower_components
npm cache clean
npm install
echo "freshmaker" | say -v cello
@gvn
gvn / gvn-sinewave-duet-1.js
Last active December 28, 2015 23:18
gvn - "Sinewave Duet"
// @gvn - "sinewave duet"
var Context = window.AudioContext || window.webkitAudioContext;
var context = new Context();
var basePitch = 120;
var phraseCount = 12;
var osc = context.createOscillator();
osc.frequency.value = 0;
osc.connect(context.destination);
@gvn
gvn / code-smell.md
Last active June 16, 2021 09:02
Eliminating Code Smell With Grunt

Eliminating Code Smell With Grunt

by Gavin Lazar Suntop @gvn

Intro

I love clean code. There, I said it. I pride myself on passing strict linting standards and keeping my code easy to read. It's not just a personal proclivity, but a choice I hope benefits other developers.

My general experience with teams has been that code style is something people care about and have strong personal preferences. Typically, at some point people get tired of dealing with inconsistency and a standardization meeting is called. This is, of course, an important discussion to have. The problem that tends to occur is either lack of documentation or lack of enforcement of the agreed upon style. Additionally, new team members or contributors may not have access to a clear set of rules.

@gvn
gvn / .jsbeautifyrc
Last active December 23, 2015 13:49
.jsbeautifyrc
{
"html": {
"brace_style": "collapse",
"indent_char": " ",
"indent_scripts": "normal",
"indent_size": 2,
"max_preserve_newlines": 1,
"preserve_newlines": true,
"unformatted": ["sub", "sup", "p", "span", "h1", "h2", "h3", "h4", "h5", "h6", "label"],
"wrap_line_length": 0
@gvn
gvn / .jshintrc
Last active December 21, 2015 07:59
My standard jshintrc.
{
"globals": {
"module": false,
"define": false,
"requirejs": false,
"require": false
},
"bitwise": true,
"browser": true,
"curly": true,
@gvn
gvn / less-to-sass.md
Last active December 19, 2015 20:59
Converting Less to Sass (.scss)

Converting Less to Sass (.scss)

Variables

Less

@variable

Scss

$variable
@gvn
gvn / gist:5731810
Last active December 18, 2015 05:19
Mac / OSX Optimizations

Mac / OSX Optimizations

CPU

Disable Window Animations

defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

2D Dock

@gvn
gvn / gist:5427031
Last active December 16, 2015 11:19
How To Join Multiple Video Files (OSX)

How To Join Multiple Video Files (OSX)

Dependencies

  • Homebrew
  • mencoder (brew install mplayer --use-gcc)
cat video1.avi video2.avi > output.avi
mencoder -forceidx -oac copy -ovc copy output.avi -o output_final.avi
@gvn
gvn / onehandword.js
Last active December 15, 2015 11:09
Generate random words that can be typed with one hand.
function randomWord(hand, length) {
var chooseVowel = !!Math.round(Math.random()),
word = '';
while (length) {
if (chooseVowel) {
word += hand.vowels[Math.floor(Math.random() * hand.vowels.length)];
} else {
word += hand.consonants[Math.floor(Math.random() * hand.consonants.length)];
}

In a repeating sequence of integers the sum of any group of concurrent integers of the same length as the pattern will always be the same.

IE:

1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 ...

5 + 1 + 2 + 3 + 4 = 15
1 + 2 + 3 + 4 + 5 = 15
4 + 5 + 1 + 2 + 3 = 15