Skip to content

Instantly share code, notes, and snippets.

View juque's full-sized avatar

Juan Pablo Aqueveque juque

View GitHub Profile
@shinzui
shinzui / tmux.conf
Created March 12, 2011 01:08 — forked from bryanl/tmux.conf
tmux.conf
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
-------------------------------------------------------------------------
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
http://sed.sourceforge.net/sed1line.txt
http://www.pement.org/sed/sed1line.txt
This file will also available in other languages:
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html
@Lobstrosity
Lobstrosity / 1.scope.js
Created August 10, 2011 00:19
JavaScript Module Pattern
var message = 'Hello!';
(function() {
var message = 'Hi!';
alert(message);
})();
@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
#########################
# FUNCTIONS
#########################
function parse_git_branch {
[ -d .git ] || return 1
git_status="$(git status 2> /dev/null)"
branch_pattern="^# On branch ([^${IFS}]*)"
remote_pattern="# Your branch is (.*)"
diverge_pattern="# Your branch and (.*) have diverged"
if [[ ! ${git_status}} =~ "working directory clean" ]]; then
{% unless product_type %}
<!-- Estamos en /collections/destacados. Listar tipos con link a /collections/destacados/types/un-tipo -->
{% include 'collection_list_types' %}
{% else %}
<!-- Estamos en /collections/destacados/types/un-tipo. Listar productos para este tipo -->
{% include 'collection_list_products' %}
{% endunless %}

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@badsyntax
badsyntax / timeago.js
Created March 26, 2012 13:06
Javascript date time ago
Ext.Date.fuzzy = function(time, local){
(!local) && (local = Date.now());
if (typeof time !== 'number' || typeof local !== 'number') {
return;
}
var
offset = Math.abs((local - time)/1000),
<div id="slideshow">
<span id="nav">
</span>
<ul class="clearfix">
{% for product in collections.destacados.products %}
<li>
<a href="{{ product.url }}">
{% if product.image_count > 1 %}
{% for img in product.images %}
{% if forloop.index == 2 %}
@ismasan
ismasan / Ratings-api.mkd
Created September 26, 2012 14:34
Booting products ratings JS

Crear rating

Request

POST /:account_key/ratings

{"uid": "http://site.bootic.net/products/foobar", "rating": 4}

(También puede ser GET con JSONp)