Skip to content

Instantly share code, notes, and snippets.

Avatar
Brewing coffee

Abe Estrada AbeEstrada

Brewing coffee
View GitHub Profile
@AbeEstrada
AbeEstrada / evaluacion.js
Created Apr 15, 2011
Javascript: Bookmarklet UANE
View evaluacion.js
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 Mar 6, 2012
Snippet: PHP Codeigniter Model
View users.php
<?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 Jan 14, 2022
Snippet: HTML5 Skeleton
View index.html
<!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>
View gist:9523016
View gist:9797292

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:

@AbeEstrada
AbeEstrada / gist:dc73b0525769383b7a87
Last active Aug 29, 2015
Given an array of strings, detect if there are any non-repeating array elements.
View gist:dc73b0525769383b7a87
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]);
}
View buttons.css
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 Aug 29, 2015
Trello Node.js Developer Challenge - https://trello.com/jobs/developer
View hash.coffee
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
View gist:dade8dc8bd46c33f47eb
# 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