Skip to content

Instantly share code, notes, and snippets.

View rafaelrinaldi's full-sized avatar

Rafael Rinaldi rafaelrinaldi

View GitHub Profile
@rafaelrinaldi
rafaelrinaldi / index.html
Created December 21, 2015 14:55
iOS toggle indicator written in pure CSS. See it in action: https://jsbin.com/harule
<label class="toggle">
<input type="checkbox" class="toggle-phony"/>
<span class="toggle-indicator"></span>
</label>
@rafaelrinaldi
rafaelrinaldi / getVisualBounds.as
Created October 20, 2010 22:40
Useful to get the real bounds of an object.
package rinaldi.display
{
import flash.display.BitmapData;
import flash.display.DisplayObject;
import flash.geom.Rectangle;
/**
*
* This method returns a Rectangle with the real visual DisplayObject bounds.
*
@rafaelrinaldi
rafaelrinaldi / caret.scss
Created November 20, 2013 21:09
Pure CSS carets mixin.
/**
* Pure CSS carets mixin.
* http://css-tricks.com/snippets/css/css-triangle
*/
@mixin caret($size: 3px, $color: #ccc, $direction: "down") {
width: 0;
height: 0;
@if $direction == "down" {
@rafaelrinaldi
rafaelrinaldi / to_png.sh
Created October 8, 2012 03:21
Convert .psd files to .png files keeping the transparency.
#!/usr/bin/env bash
#
# Convert .psd files to .png files keeping the transparency.
# It uses `imagemagick` library.
# Usage:
#
# sh to_png.sh path/
#
# Author: Rafael Rinaldi (rafaelrinaldi.com)
const ButtonWithPadding = ({ children, ...props }) =>
<button style={{ padding: '15px 10px' }} {...props}>{children}</button>
const ButtonPrimary = ({ children, ...props }) =>
<button style={{ color: 'white', backgroundColor: 'seagreen' }} {...props}>{children}</button>
const ButtonOutline = ({ children, ...props}) =>
<button style={{ backgroundColor: 'transparent', border: '4px solid darkred' }} {...props}>{children}</button>
const ButtonBase = ({ children, ...props }) => <button {...props}>{children}</button>;
set -x LSCOLORS ExFxCxDxBxegedabagacad
set -x LC_CTYPE en_US.UTF-8
set -x EDITOR nvim
set -x VIMRC $HOME/.vimrc
set -x TMUXRC $HOME/.tmux.conf
set -x FISHRC $HOME/.config/fish/config.fish
# $PATH equivalent
set -U fish_user_paths /usr/local/bin
Team
Name Role
Andre Carvalho Technology Director
Andy Baudoin Lead Developer
Bethany Pensworth Project Manager
Chris James Lead Developer
Jim Watkins QA Analyst
@rafaelrinaldi
rafaelrinaldi / getUserMedia.js
Last active September 12, 2018 15:05
Lazy way to check if a device supports getUserMedia.
function getUserMedia() {
// Since sometimes there's API support but stuff doesn't actually work, make a usage test.
// Add a fake image file input to memory.
var input = $('<input type="file" accept="image/*" capture="camera">');
// Test if input is enabled.
return input.is(':enabled'); // `true` if device actually supports getUserMedia API.
}
@rafaelrinaldi
rafaelrinaldi / parcel-test.js
Created July 11, 2018 19:48
parcel-test.js
parcelRequire = (function (init) {
// Save the require from previous bundle to this closure if any
var previousRequire = typeof parcelRequire === 'function' && parcelRequire;
var nodeRequire = typeof require === 'function' && require;
var modules = {};
function localRequire(name, jumped) {
if (name in modules) {
return modules[name];
}
import React from 'react';
import { StyleSheet, css } from 'aphrodite/no-important';
import helpers from '../theme/helpers';
/**
* Base component that reduces boilerplate and enforces consistency.
* Highly inspired by the work done by the Hyperterm team.
*/
const hoc = Component =>