Skip to content

Instantly share code, notes, and snippets.

@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 / users.php
Created March 6, 2012 23:48
Snippet: PHP Codeigniter Model
<?php
class Users extends CI_Model {
function add($options=array()) {
// required values
if (!$this->_required(array('email'), $options)) return false;
// default values
$options = $this->_default(array('status'=>'active'), $options);
// qualification (make sure that we're not allowing the site to insert data that it shouldn't)
@AbeEstrada
AbeEstrada / index.html
Last active January 14, 2022 00:10
Snippet: HTML5 Skeleton
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Title</title>
<link rel="stylesheet" type="text/css" href="reset.css" />
</head>
<body>
<div id="root"></div>

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
# 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 [email protected]
=================================================================================
~/.ssh/config