Skip to content

Instantly share code, notes, and snippets.

View millermedeiros's full-sized avatar

Miller Medeiros millermedeiros

View GitHub Profile
@millermedeiros
millermedeiros / osx_setup.md
Last active May 7, 2024 08:01
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@millermedeiros
millermedeiros / .vimrc
Last active December 11, 2023 14:44
My VIM settings (.vimrc)
" =============================================================================
" Miller Medeiros .vimrc file
" -----------------------------------------------------------------------------
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory, ...
" =============================================================================
" -----------------------------------------------------------------------------
" BEHAVIOR
@millermedeiros
millermedeiros / default.css
Created January 9, 2011 17:55
Default CSS file
/**
* Awesome website
* @author YOUR_NAME_HERE
* @version 0.1
*/
/* ============================ RESET ============================ */
/* ===== Eric Meyer Reset ===== */
@millermedeiros
millermedeiros / gist:882682
Created March 23, 2011 05:47
RequireJS Async Load Plugin
/*!
* RequireJS plugin for async dependency load like JSONP and Google Maps
* @author Miller Medeiros
* @version 0.0.1 (2011/03/23)
* Released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
define(function(){
function injectScript(src){
var s, t;
@millermedeiros
millermedeiros / sample-hasher_crossroads.html
Created July 27, 2011 16:28
Using hasher together with crossroads.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>example crossroads + hasher</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="wrapper">
<ul>
@millermedeiros
millermedeiros / example.js
Last active September 10, 2022 03:06
execute multiple shell commands in series on node.js
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');
}});
@millermedeiros
millermedeiros / gist:891886
Created March 29, 2011 06:21
iPad HTML5 video quirks and hacks
/*
* Example how to preload HTML5 video on the iPad (iOS 3.2+)
* @author Miller Medeiros
* Released under WTFPL
*/
var vid = document.createElement('video');
vid.src = 'lol_catz.mp4';
document.getElementById('video-holder').appendChild(vid);
@millermedeiros
millermedeiros / gist:3136745
Created July 18, 2012 15:06
find closest number in the sequence (1, 5, 10, 50, 100, 500, 1000, ...) that generates less than "n" steps
//
// find closest number in the sequence (1, 5, 10, 50, 100, 500, 1000, ...)
// that generates less than "n" steps
// ---
// useful for subdividing charts and any other things that requires a scale
// that follows reasonable numbers
//
function getStepSize(val, maxNSteps) {
var nSteps;
var stepSize = 1;
@millermedeiros
millermedeiros / b2g.sh
Created March 25, 2014 16:25
shell aliases and commands to help Gaia/B2G (Firefox OS) development - specially for the "productivity" apps
# based on https://github.com/gnarf/.dotfiles/blob/master/b2g.sh
# =============================================================================
export FIREFOX="/Applications/FirefoxNightly.app/Contents/MacOS/firefox"
export GAIA_DIR="/Users/millermedeiros/Projects/gaia"
alias firefox="$FIREFOX"
alias b2g-bin="$GAIA_DIR/b2g/Contents/MacOS/b2g-bin"
alias b2g="b2g-bin"
@millermedeiros
millermedeiros / gist:837780
Created February 21, 2011 22:02
Simple Sorted Insertion
/**
* Add items to Array in a sorted order.
* @param {Array} arr
* @param {Number} item
* @author Miller Medeiros
* Released under the WTFPL (http://sam.zoy.org/wtfpl/)
*/
function sortedInsert(arr, item){
var n = arr.length;
do { n--; } while (item < arr[n]);