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
Start with Fedora 17
yum install -y git vim rubygem-thor rubygem-parseconfig tito make rubygem-aws-sdk tig mlocate bash-completion rubygem-yard rubygem-redcarpet ruby-devel redhat-lsb
yum install -y http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-3.10.0-160.fc17.noarch.rpm http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-devel-3.10.0-160.fc17.noarch.rpm http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-doc-3.10.0-160.fc17.noarch.rpm http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-minimum-3.10.0-160.fc17.noarch.rpm http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-mls-3.10.0-160.fc17.noarch.rpm http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-targeted-3.10.0-160.fc17.noarch.rpm
gem install rspec -v '1.1.12'
for i in origin-
@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