Skip to content

Instantly share code, notes, and snippets.

View alvin-milton's full-sized avatar
🤠
yee haw

Alvin Milton alvin-milton

🤠
yee haw
  • New York
View GitHub Profile
var ismobil,
date = new Date(),
expires,
nameEQ,
ca,
c,
i,
x,
redirectagent,
redirect_devices,
@alvin-milton
alvin-milton / is_uiwebview.js
Last active May 12, 2016 17:33
is_uiwebview javascript
var is_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent)
alert(is_uiwebview);
var i = 1;
for (i; i <= 100; i++) {
if ((i % 3 === 0) && (i % 5 === 0)) {
console.log('fizzbuzz');
} else if (i % 5 === 0) {
console.log('buzz');
} else if (i % 3 === 0) {
console.log('fizz');
} else {
brew install node --without-npm
mkdir "${HOME}/.npm-packages"
echo NPM_PACKAGES="${HOME}/.npm-packages" >> ${HOME}/.bashrc
echo prefix=${HOME}/.npm-packages >> ${HOME}/.npmrc
curl -L https://www.npmjs.org/install.sh | sh
echo NODE_PATH=\"\$NPM_PACKAGES/lib/node_modules:\$NODE_PATH\" >> ${HOME}/.bashrc
echo PATH=\"\$NPM_PACKAGES/bin:\$PATH\" >> ${HOME}/.bashrc
echo source "~/.bashrc" >> ${HOME}/.bash_profile
source ~/.bashrc
@alvin-milton
alvin-milton / collect_npms.js
Created March 22, 2016 02:26
Collects NPM names into a list
var fs = require("fs");
function main() {
fs.readdir("./node_modules", function (err, dirs) {
if (err) {
console.log(err);
return;
}
dirs.forEach(function(dir){
if (dir.indexOf(".") !== 0) {
<amp-iframe width="320" height="400" src="https://cache.vevo.com/assets/html/embed.html?video=USRV81501030&amp;autoplay=0" layout="responsive" sandbox="allow-scripts" class="-amp-element -amp-layout-responsive -amp-layout-size-defined -amp-layout" id="AMP_18">
<i-amp-sizer style="display: block; padding-top: 125%;"></i-amp-sizer>
<i-amp-scroll-container>
<iframe class="-amp-fill-content" width="320" height="400" name="amp_iframe0" sandbox="allow-scripts" src="https://cache.vevo.com/assets/html/embed.html?video=USRV81501030&amp;autoplay=0"></iframe>
</i-amp-scroll-container>
</amp-iframe>
@alvin-milton
alvin-milton / friends_and_fuckboys.coffee
Last active October 1, 2015 20:24
coffeescript splat, functions, parsing arrays, and fuckboys
peace = (a) ->
str = "what up, #{a}!"
console.log(str)
war = (a) ->
str = "You suck, #{a}!"
console.log(str)
shoutout = (a, b, c, toomany...) ->
peace a