Skip to content

Instantly share code, notes, and snippets.

View funkytaco's full-sized avatar

Luis Gonzalez funkytaco

View GitHub Profile
if [ -z "\${which tree}" ]; then
tree () {
find $@ -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
}
fi
sudo: false
language: php
matrix:
include:
- php: 5.5
env: WP_TRAVISCI=travis:js
- php: 5.2
env: WP_TRAVISCI=travis:phpunit
- php: 5.3
env: WP_TRAVISCI=travis:phpunit
@funkytaco
funkytaco / gist:e28d3ef5b9e4f705bacd
Created February 26, 2015 19:48
rlemon is lemony
var express=require("express"),gm=require("gm"),fs=require("fs"),app=express();var imagePath="./images/",image404="status404.jpg",imagePool=fs.readdirSync(imagePath).filter(function(name){return name!==image404}),imagePoolLength=imagePool.length;
app.set("view engine","ejs").use(express["static"](__dirname+"/public")).get(/[\/i]?\/([0-9]+)\/([0-9]+)/,function(req,res){var width=req.params[0],height=req.params[1],id=imagePool[Math.floor(Math.random()*imagePoolLength)];if(width>1920)width=1920;if(width<1)width=1;if(height>1080)height=1080;if(height<1)height=1;gm(imagePath+id).resize(width,height,"^").gravity("Center").crop(width,height).compress("BZip").stream(function(err,stdout,stderr){res.set("Content-Type","image/jpeg");if(err)console.log(err);
stdout.pipe(res)})}).get("/",function(req,res){res.render("index.ejs")}).use(function(req,res,next){res.status(404);gm(imagePath+image404).stream(function(err,stdout,stderr){res.set("Content-Type","image/jpeg");if(err)console.log(err);stdout.pipe(res)})}).listen(7076
@funkytaco
funkytaco / gist:272dee20f40c35840f98
Created March 5, 2015 06:19
PSR-2-coding-style-guide.md

Coding Style Guide

This guide extends and expands on [PSR-1], the basic coding standard.

The intent of this guide is to reduce cognitive friction when scanning code from different authors. It does so by enumerating a shared set of rules and expectations about how to format PHP code.

The style rules herein are derived from commonalities among the various member

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {
@funkytaco
funkytaco / gist:6c788d7542e308037161
Created March 21, 2015 04:36
seizure-inducing trippy code by @rlemon
(function t(){function c(){return"#"+Math.random().toString(16).slice(-6)}for(i=0,l=document.all;i<l.length;)with(l[i++].style)color=c(),backgroundColor=c();setTimeout(t,0)})()
@funkytaco
funkytaco / README.md
Last active August 29, 2015 14:21 — forked from smileart/README.md

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@funkytaco
funkytaco / README.md
Last active August 29, 2015 14:21 — forked from agnoster/README.md

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

#!/bin/sh
# Must have boot2docker installed if using Mac OS X
installMachineMac() {
sudo wget --no-check-certificate -O /usr/local/bin/docker-machine http://docker-machine-builds.evanhazlett.com/latest/docker-machine_darwin_amd64
sudo chmod +x /usr/local/bin/docker-machine
}
installDockerBinMac(){
sudo wget --no-check-certificate -O /usr/local/bin/docker https://get.docker.com/builds/Darwin/x86_64/docker-latest