Skip to content

Instantly share code, notes, and snippets.

surfing bits and bytes

antonio miranda am

surfing bits and bytes
Block or report user

Report or block am

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
am / layersToArtboards.jsx
Last active Dec 12, 2018
Illustrator util to copy layers content to artboards
View layersToArtboards.jsx
// based on
// 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 / custom.css
Last active Oct 9, 2018
Gmail Dark Overrides
View custom.css
/* sidebar */
.aZ6 {
background-color: #282a2e;
/* sidebar-bottom */
.bhZ.bym .aj5, .vhZ.bjB .aj5 {
background-color: #1d1f21;
/* header */
am / detectBrowserLanguage.js
Last active Feb 9, 2018 — forked from leipert/detectBrowserLanguage.js
Detect browser language in javascript (utilizing lodash/fp)
View detectBrowserLanguage.js
// 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 / child.html
Last active Sep 14, 2017
Load unload iframe - performance / memory
View child.html
<p>Loaded Content</p>
var i, el = null,
x = [];
for (i = 0; i < 10000; i++) {
am / shell
Created Jan 26, 2014
Kaleidodcope "xcrun: error: cannot be used within an App Sandbox..."
View shell
cd /Applications/
am / post_mirror.rb
Created Jan 21, 2014
Sinatra server that mirrors the POST variables in .json format
View post_mirror.rb
require 'sinatra'
require 'sinatra/json'
post '/' do
json params
View Preferences.sublime-settings
"color_scheme": "Packages/Theme - Spacegray/base16-eighties.dark.tmTheme",
"theme": "Spacegray Eighties.sublime-theme",
"font_face": "Menlo",
"font_size": 12,
am / track.js
Created Sep 10, 2013
Page scarping with phantomjs: `phantomjs track.js XXXXXXXX output.txt` XXXXXXXX is a TNT tracking code
View track.js
var page = require('webpage').create(),
args = require('system').args;
if (args.length === 1) {
console.log('Missing track ID, "phantomjs track.js XXXXXXXX"');
else {
args.forEach(function(arg, i) {
am / Vagrantfile
Created Apr 23, 2013
Vagrant box to compile stasis projects (gems: stasis, haml, coffee-script, sass, rhc).
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config| = "precise64"
config.vm.box_url = "/Users/am/Downloads/" :forwarded_port, guest: 4000, host: 4000
config.vm.hostname = 'stasis-box'
config.vm.provision :puppet do |puppet|
You can’t perform that action at this time.