Skip to content

Instantly share code, notes, and snippets.

View oswaldoacauan's full-sized avatar
🔮
Snapshot tests are bad. Change my mind.

Oswaldo Acauan oswaldoacauan

🔮
Snapshot tests are bad. Change my mind.
View GitHub Profile

keybase.md

Fonte: http://gohorseprocess.wordpress.com
1- Pensou, não é XGH.
XGH não pensa, faz a primeira coisa que vem à mente. Não existe
segunda opção, a única opção é a mais rápida.
2- Existem 3 formas de se resolver um problema, a correta, a errada e
a XGH, que é igual à errada, só que mais rápida.
@oswaldoacauan
oswaldoacauan / swfextract
Created March 22, 2015 02:50
SWFExtract All Files
#!/bin/sh
for i in ./*.swf ; do
for j in `swfextract $i | grep -E PNGs.* -o | grep -E [0-9]+ -o` ; do
echo "$i -> extract png $j";
swfextract -p "$j" "$i" -o "$i"_"$j".png
done
for j in `swfextract $i | grep -E JPEGs.* -o | grep -E [0-9]+ -o` ; do
echo "$i -> extract jpeg $j";
swfextract -j "$j" "$i" -o "$i"_"$j".jpg
done
@oswaldoacauan
oswaldoacauan / structure
Created July 1, 2014 17:49
Welcome document
# Architecture
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| |– _all.scss # To be imported
| ... # etc…
|
@oswaldoacauan
oswaldoacauan / styleguide.md
Created May 2, 2014 13:23
Ghostium - Styleguide Markdown
//
// Variables
// --------------------------------------------------
// Global values
// --------------------------------------------------
// Grays
// -------------------------
@oswaldoacauan
oswaldoacauan / devices-viewport.js
Created December 16, 2013 11:44
JS - List of devices and his viewports to use with grunt-screenshot, snippet proudly "stolen" from yeoman generator-mobile.
var devices = [
{
name: 'G1',
width: 320,
height: 480,
density: 1
}, {
name: 'Nexus S',
width: 480,
height: 800,
@oswaldoacauan
oswaldoacauan / gist:7580474
Created November 21, 2013 12:06
jQuery - Serialize Form with File inputs
(function($) {
$.fn.serializeFiles = function() {
var form = $(this),
formData = new FormData()
formParams = form.serializeArray();
$.each(form.find('input[type="file"]'), function(i, tag) {
$.each($(tag)[0].files, function(i, file) {
formData.append(tag.name, file);
});
@oswaldoacauan
oswaldoacauan / gist:7317402
Created November 5, 2013 11:04
CSS - Position Fixed and Scroll on Mobile
.mobile-scrollable {
overflow: scroll;
-webkit-overflow-scrolling: touch;
}
@oswaldoacauan
oswaldoacauan / gist:7081881
Created October 21, 2013 10:42
Javascript - Time Since function
function timeSince(date) {
var seconds = Math.floor(((new Date().getTime()/1000) - date)),
interval = Math.floor(seconds / 31536000);
if (interval > 1) return interval + "y";
interval = Math.floor(seconds / 2592000);
if (interval > 1) return interval + "m";
interval = Math.floor(seconds / 86400);