Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am AbeEstrada on github.
  • I am AbeEstrada (https://keybase.io/AbeEstrada) on keybase.
  • I have a public key whose fingerprint is EC49 34DF 45F0 FF2C 17F9 FA44 C83D 86F9 6EFC 028B

To claim this, I am signing this object:

function isMobile() {
return navigator.userAgent.toLowerCase().indexOf("mobile") >= 0;
}
@AbeEstrada
AbeEstrada / gist:dc73b0525769383b7a87
Last active August 29, 2015 14:13
Given an array of strings, detect if there are any non-repeating array elements.
function hasSingleElements(arr) {
if (arr.length > 0) {
var r = [];
for (var i = 0; i < arr.length; i++) {
var e = r.indexOf(arr[i]);
if (e > -1) {
r.splice(e, 1);
} else {
r.push(arr[i]);
}
@AbeEstrada
AbeEstrada / buttons.css
Last active August 29, 2015 14:14
dubizzle
body, .button {
font-family: helvetica, arial, sans-serif;
font-size: 15px;
line-height: 1.5;
}
.button {
background-repeat: no-repeat;
display: inline-block;
font-family: sans-serif;
@AbeEstrada
AbeEstrada / hash.coffee
Last active August 29, 2015 14:15
Trello Node.js Developer Challenge - https://trello.com/jobs/developer
letters = "acdegilmnoprstuw"
hash = (s) ->
h = 7
for l in s
h = (h * 37 + letters.indexOf(l))
h
rhash = (h) ->
return rhash((h - (h % 37)) / 37) + letters[h % 37] if h > letters.length
@AbeEstrada
AbeEstrada / evaluacion.js
Created April 15, 2011 17:01
Javascript: Bookmarklet UANE
var s=document.createElement('script');
s.setAttribute('src','http://jquery.com/src/jquery-latest.js');
document.getElementsByTagName('body')[0].appendChild(s);
jQuery('input[value=100]').attr('checked', 'checked');
@AbeEstrada
AbeEstrada / brew.sh
Last active December 6, 2016 06:40
macOS
xcode-select --install
brew install bash
echo /usr/local/bin/bash >> /etc/shells
chsh -s /usr/local/bin/bash
brew install awscli git ssh-copy-id wget
# https://github.com/henrikpersson/rsub
# http://chen.do/blog/2013/09/16/editing-files-on-a-remote-server-with-sublime-text-2/
# http://www.lleess.com/2013/05/how-to-edit-remote-files-with-sublime.html
# http://leon.radley.se/2012/03/sublime-text-2-rsub/
$ ssh -R 52698:127.0.0.1:52698 user@example.org
=================================================================================
~/.ssh/config
@AbeEstrada
AbeEstrada / main.go
Last active June 6, 2017 19:54
coins, get the current price of BTC, ETH and LTC from the Coinbase API
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"time"
)