Skip to content

Instantly share code, notes, and snippets.

Rafael R rafaelrinaldi

Block or report user

Report or block rafaelrinaldi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View jquery.iterate.js
/**
* 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
View range_slider.js
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
@rafaelrinaldi
rafaelrinaldi / jquery.visibility-toggle.js
Created Feb 24, 2014
Simple jQuery plugin to toggle between shown/hidden states.
View jquery.visibility-toggle.js
/**
* 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:
*
View byData.js
$.fn.byData = function (propertyName) {
return $(this).find('[data-' + propertyName + ']');
};
View flex.scss
@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, "%");
}
View global.js
/*
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"]} },
View remove-unit.scss
@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;
}
View siga.md

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

View prompt.sh
#!/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
View data.js
define([
'signals',
'hogan',
'mout/lang/isString',
'mout/object/forOwn'
], function(
Signal,
Hogan,
isString,
forOwn
You can’t perform that action at this time.