Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View millermedeiros's full-sized avatar

Miller Medeiros millermedeiros

View GitHub Profile
@millermedeiros
millermedeiros / gist:3057782
Created July 6, 2012 02:52
Links sobre otimização de performance (WPO)
@millermedeiros
millermedeiros / .htaccess
Created June 11, 2012 13:34
basic htaccess for perf
DirectoryIndex index.html index.htm index.php
ErrorDocument 404 /404
# Block directory listing
Options -Indexes
# === URL Rewrite === #
# Map all URIs except those corresponding to existing files/folders to the handler
RewriteEngine on
@millermedeiros
millermedeiros / gist:2690836
Created May 13, 2012 23:52 — forked from karlwestin/gist:2690501
Refactoring JS for testing part 5 – refactor
/*
* Karl Westin
* Part of the "refactoring javascript for unit testing" blog post
* ---
* Quick refactor by Miller Medeiros (http://blog.millermedeiros.com)
* Didn't tested the code during/after changes, might contain errors.
*/
function Lightbox(parent) {
@millermedeiros
millermedeiros / build.js
Created May 9, 2012 01:15
sample node.js build script including RequireJS optimizer (r.js) and copy/delete/filter files
// Combine JS and CSS files
// ---
//
// Make sure you install the npm dependencies
// > cd YOUR_PROJECT_FOLDER
// > npm install
//
// Than run:
// > node build
@millermedeiros
millermedeiros / gist:2596657
Created May 4, 2012 18:05
"safe/strict" data store object
define(function(){
//just so we can check against undefined and set val as undefined
var UNDEF;
// here you create the "interface", trying to get/set any other property
// will throw errors before build (see pragmas on get).
var _data = {
foo : UNDEF,
bar : UNDEF,
@millermedeiros
millermedeiros / gist:1873712
Created February 21, 2012 04:38
how to filter and batch delete files on node.js
var DIST_FOLDER = '../deploy/';
// ---
var _minimatch = require('minimatch'),
_wrench = require('wrench'),
_fs = require('fs'),
_path = require('path');
function purgeDeploy(){
@millermedeiros
millermedeiros / index.html
Created January 4, 2012 17:46
Simple Markdown previewer with github-style codeblocks support
<!doctype html>
<meta charset="utf-8">
<title>Using Showdown with and without jQuery: demo</title>
<style>
textarea, #preview { width: 500px; height: 150px; margin-bottom: 1em; padding: .5em 1em; overflow-y:auto}
#preview { border: 1px solid #666; }
</style>
<link rel="first" href="http://mathiasbynens.be/notes/showdown-javascript-jquery" title="Using Showdown with and without jQuery">
<link rel="prefetch" href="http://mathiasbynens.be/notes/showdown-javascript-jquery" title="Using Showdown with and without jQuery">
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/default.min.css">
@millermedeiros
millermedeiros / wordcount.vim
Created November 10, 2011 22:30
wordcount.vim : fast word and char count for vim to be used on the status line
" ============================================================================
" File: wordcount.vim
" Maintainer: Miller Medeiros <http://blog.millermedeiros.com/>
" Description: Fast Word and Char count to be used on the statusline.
" based on Greg Sexton script: http://bit.ly/v3RfAv
" Last Change: 2011-11-10
" License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
@millermedeiros
millermedeiros / gist:1340046
Created November 4, 2011 18:09
node.js CLI to compress TexturePacker JSON-Array data
#!/usr/bin/env node
//npm install commander
/**
* Command line tool to convert TexturePacker JSON-Array data into
* optimized SpriteAnim.js JSON data file.
* @author Miller Medeiros
* @version 0.1.0 (2011/10/18)
*/