Skip to content

Instantly share code, notes, and snippets.

View 0xjjpa's full-sized avatar
🔒
Hiding encrypted secrets

Jose Aguinaga 0xjjpa

🔒
Hiding encrypted secrets
View GitHub Profile
@0xjjpa
0xjjpa / header.html
Created February 2, 2012 16:52
Load local jQuery in case CDN doesn't (for PyroCMS themes)
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{{ theme:path }}/js/libs/jquery.js"><\/script>')</script>
@0xjjpa
0xjjpa / ISO Week Number
Created April 18, 2012 17:57
Getting year's week number
/* For a given date, get the ISO week number
*
* Based on information at:
*
* http://www.merlyn.demon.co.uk/weekcalc.htm#WNR
*
* Algorithm is to find nearest thursday, it's year
* is the year of the week number. Then get weeks
* between that date and the first day of that year.
*
@0xjjpa
0xjjpa / gist:2424339
Created April 19, 2012 21:30
Debugging Knockout JS
<section class="content">
<h2>Debug</h2>
<div data-bind="text: ko.toJSON($data)"></div>
</section>
@0xjjpa
0xjjpa / gist:3155012
Created July 21, 2012 07:44 — forked from anonymous/gist:2661058
Ziggurat for Firefox
var win = gBrowser.selectedBrowser.contentWindow;
var doc = win.document;
var output = doc.createElement("div");
output.id = "output";
doc.body.appendChild(output);
var style = doc.createElement("style");
style.innerHTML = "div#output { margin-top: 10em; white-space: pre; } div#output span { padding: 0.6em; margin: 0 0.6em; border: 1px solid rgba(0, 0, 0, 0.8); border-radius: 0.2em; box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4); position: relative; bottom: 1em; background-color: #ff5454; } div#output span > span { background-color: #ffa054; } div#output span > span > span { background-color: #ffff54; } div#output span > span > span > span { background-color: #8cd446; } div#output span > span > span > span > span { background-color: #45d2b0; } div#output span > span > span > span > span > span { background-color: #438ccb; } div#output span > span > span > span > span > span > span { background-color: #8c3fc0; } div#output span > span > span > span > span > span > span > span { background-color: #d145c1; } div#o
@0xjjpa
0xjjpa / makefile
Created August 3, 2012 13:30
Watcher for Jade, LESS and CoffeeScript
JADE = $(shell find . -name *.jade)
HTML = $(JADE:.jade=.html)
LESS = $(shell find -name *.less)
CSS = $(LESS:.less=.css)
COFF = $(shell find -name *.coffee)
JS = $(COFF:.coffee=.js)
all: html css js
@0xjjpa
0xjjpa / .bashrc_profile
Created August 9, 2012 13:32
.bashrc and .profile for NVM and RVM to work with Sublime Text 2 (Ubuntu 12.04)
###################### .bashrc ########################
# Bash For NVM
. ~/nvm/nvm.sh
# Other
# [[ -s "$HOME/.nvm" ]] && . "$HOME/.nvm/nvm.sh" # This loads NVM into a shell se$
# Bash For RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
@0xjjpa
0xjjpa / index.php
Created August 9, 2012 14:24
[ Fix ] Stop Xboilerplate from trying to "LESS" CSS files.
<?php
/**
* xBoilerplate: Xodoa Boilerplate
*
* @category xBoilerPlate
* @package Xodoa
* @copyright Copyright (c) 2007-2012 Xodoa (http://xodoa.com)
* @author Nicolas Ruflin <ruflin@xodoa.com>
*/
@0xjjpa
0xjjpa / index.jade
Created August 24, 2012 12:23
[Jade] HTML Template for Contao CMS
doctype 5
html
head
title TITLE
link(rel="stylesheet", type="text/css", href="css/grid.css")
link(rel="stylesheet", type="text/css", href="css/style.css")
body
#header
.container
h1
@0xjjpa
0xjjpa / encoded.js
Created October 7, 2012 23:46
Decode Encoded String to POST it
var decoded = $("<div/>").html(encodedStr).text();
@0xjjpa
0xjjpa / install.md
Created October 21, 2012 01:33 — forked from svnlto/install.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, nvm

Setup new Mac with OSX Lion from scratch

Latest update 20-Oct-2012. me@jjperezaguinaga.com

Command Line Tools are required for Homebrew. Previously it was suggested to download Xcode 4, but since the new version doesn't ship the proper gcc compiler for rvm, the command line tools are a better option and then using homebrew to get the gcc compiler. If preferred, install Xcode 4, although this setup doesn't follow that set of instructions.

Really the nicest choice for a terminal on OSX right now, especially with Lion style full screen support.