Skip to content

Instantly share code, notes, and snippets.

View rafaelrinaldi's full-sized avatar

Rafael Rinaldi rafaelrinaldi

View GitHub Profile
/**
* Simple jQuery plugin to iterate through a list of values.
*
* Markup:
*
* <a data-iterate='foo,bar,baz'>Click to iterate</a>
*
* Usage:
*
* $('a').iterate(); // bar
Module('Application.UI.RangeSlider', function(RangeSlider) {
// basic ui element properties/methods
var UIElement = Module.fetch('Application.UI.UIElement');
// applying UIElement "interface"
RangeSlider.fn = $.extend(this, UIElement);
RangeSlider.fn.initialize = function() {
// stuff happens here
$.fn.byData = function (propertyName) {
return $(this).find('[data-' + propertyName + ']');
};
@rafaelrinaldi
rafaelrinaldi / jquery.visibility-toggle.js
Created February 24, 2014 20:41
Simple jQuery plugin to toggle between shown/hidden states.
/**
* Simple jQuery plugin to toggle between shown/hidden states.
*
* Markup:
*
* <div class='box' style='width: 50px; height: 50px; background: red; padding: 20px;'>Box</div>
* <button>Toggle</button>
*
* Usage:
*
@function remove-unit($number) {
$unit: unit($number);
$one: 1;
@if $unit == "px" { $one: 1px; }
@if $unit == "em" { $one: 1em; }
@if $unit == "%" { $one: 1%; }
@return $number / $one;
}
@function flex($target, $context, $unit: "em") {
$size: remove-unit($target) / remove-unit($context);
@if $unit == "em" { @return #{$size}em; }
@if $unit == "%" { @return perc($size); }
}
@function perc($target, $context) {
@return flex($target, $context, "%");
}
/*
On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings,
and don't need to be repeated here. Anything listed here will take precedence, however.
*/
[
{ "keys": ["super+shift+n"], "command": "new_window" },
{ "keys": ["super+shift+w"], "command": "close_window" },
{ "keys": ["super+o"], "command": "prompt_open" },
{ "keys": ["super+shift+t"], "command": "reopen_last_file" },
{ "keys": ["super+alt+up"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "h", "ipp", "inl", "m", "mm"]} },

Siga

Features

Mapa

Mapa geral da Grande SP com todas as estações de metrô. A idéia é que isso seja um Google Maps integrado com algum tipo de customização visual básica. Essa é uma grande candidata para ser a tela da "home".

Trajeto

#!/bin/bash
# Adapted from: https://github.com/addyosmani/dotfiles
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
# Shamelessly copied from https://github.com/gf3/dotfiles
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then
define([
'signals',
'hogan',
'mout/lang/isString',
'mout/object/forOwn'
], function(
Signal,
Hogan,
isString,
forOwn