Skip to content

Instantly share code, notes, and snippets.

View am's full-sized avatar
🌊
surfing bits and bytes

antonio miranda am

🌊
surfing bits and bytes
View GitHub Profile
@am
am / layersToArtboards.jsx
Last active December 12, 2018 20:57
Illustrator util to copy layers content to artboards
// based on https://github.com/michaelchaize/appliness/blob/master/Illustrator-create-artboards/CreateArtboardsLayers.jsx
// Illustrator util to copy layers content to artboards
// Each layer must contain one single group
// It will name the artboard to match the layer name
// For each 20 layers it creates a new row
// Ensure the original artboard is placed in the top left corner
// TODO: translate the original artboard on the top left corner
@am
am / custom.css
Last active October 9, 2018 16:15
Gmail Dark Overrides
/* sidebar */
.aZ6 {
background-color: #282a2e;
}
/* sidebar-bottom */
.bhZ.bym .aj5, .vhZ.bjB .aj5 {
background-color: #1d1f21;
}
/* header */
@am
am / vim-resources.md
Created August 31, 2018 22:05
Vim learning resources for a emacs user
@am
am / detectBrowserLanguage.js
Last active February 9, 2018 11:19 — forked from leipert/detectBrowserLanguage.js
Detect browser language in javascript (utilizing lodash/fp)
// These window.navigator contain language information
// 1. languages -> Array of preferred languages (eg ["en-US", "zh-CN", "ja-JP"]) Firefox^32, Chrome^32
// 2. language -> Preferred language as String (eg "en-US") Firefox^5, IE^11, Safari,
// Chrome sends Browser UI language
const browserLanguagePropertyKeys = ['languages', 'language'];
const availableLanguages = ['en', 'es'];
const detectedLocale = _.flow(
_.pick(browserLanguagePropertyKeys), // Get only language properties
_.values, // Get values of the properties
@am
am / child.html
Last active September 14, 2017 09:20
Load unload iframe - performance / memory
<html>
<head></head>
<body>
<p>Loaded Content</p>
<script>
(function(){
var i, el = null,
x = [];
for (i = 0; i < 10000; i++) {
@am
am / shell
Created January 26, 2014 11:35
Kaleidodcope "xcrun: error: cannot be used within an App Sandbox..."
cd /Applications/Kaleidoscope.app/Contents/Resources/Integration/scripts
./install_git-default
@am
am / post_mirror.rb
Created January 21, 2014 13:47
Sinatra server that mirrors the POST variables in .json format
require 'sinatra'
require 'sinatra/json'
post '/' do
json params
end
@am
am / Preferences.sublime-settings
Created January 20, 2014 09:44
Sublime 3 settings
{
"color_scheme": "Packages/Theme - Spacegray/base16-eighties.dark.tmTheme",
"theme": "Spacegray Eighties.sublime-theme",
"ignored_packages":
[
"Vintage",
"Markdown"
],
"font_face": "Menlo",
"font_size": 12,
@am
am / track.js
Created September 10, 2013 06:42
Page scarping with phantomjs: `phantomjs track.js XXXXXXXX output.txt` XXXXXXXX is a TNT tracking code
var page = require('webpage').create(),
args = require('system').args;
if (args.length === 1) {
console.log('Missing track ID, "phantomjs track.js XXXXXXXX"');
phantom.exit();
}
else {
args.forEach(function(arg, i) {
@am
am / Vagrantfile
Created April 23, 2013 11:00
Vagrant box to compile stasis projects (gems: stasis, haml, coffee-script, sass, rhc).
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "/Users/am/Downloads/precise64.box"
config.vm.network :forwarded_port, guest: 4000, host: 4000
config.vm.hostname = 'stasis-box'
config.vm.provision :puppet do |puppet|