Skip to content

Instantly share code, notes, and snippets.

View alejandro's full-sized avatar

Alejandro Morales alejandro

  • Revls
  • Tegucigalpa, Honduras
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Spectacular</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@alejandro
alejandro / server.js
Created June 26, 2012 00:34 — forked from anonymous/server.js
mookmike sockets
//Dependencies
var http = require('http')
, express = require('express')
, stylus = require('stylus')
, nib = require('nib')
, app = express()
;
var bind = function (str, vars) {
return str.replace(/(^|[^\\])\:(\w*)/g, function (v, w, x) {
return w + vars[x]
})
}
var query = bind('INSERT INTO table1 SER field1 = :field1, field2 = :field2 ON DUPLICATE KEY UPDATE field2 = :field2', {field1: 1, field2: 2}))
conn.query(query);
IWitness.LinkifiedContent = Ember.Mixin.create({
contentText: function() {
var linkRegex = /(((http|https):\/\/)[\w-]+\.([\w-]+\.?)+|([\w-]+\.){2,}\w+)(:[0-9]+)?[\w#!:.?+=&%@!\-\/]*/g;
var result = this.getPath("model.contentText");
var match;
var reCount = 0;
var links = {};
var placeholder;
var media_links = _.map(this.getPath('model.media.displayable'), function(media){
@alejandro
alejandro / dabblet.css
Created June 3, 2012 02:34 — forked from anonymous/dabblet.css
Untitled
body {
background:#eee;
}
#w {
height:1500px;
width:100%;
right:10px;
background:#eee;
}
::-webkit-scrollbar {height: 16px;overflow: visible;width:26px;}
@alejandro
alejandro / unfollows.js
Created May 4, 2012 04:23
Twitter watcher
#!/usr/bin/env node
"use strict";
var USERNAME = process.argv[2] || '_alejandromg';
if (parseFloat(process.version.substr(1), 10) < 0.6){
throw new Error('I can\'t work in node-' + process.version);
}
var http = require('http')
var events = require('events');
var util = require('util');
var http = require('http');
var options = {
hostname : 'api.twitter.com',
port : 80,
method : 'get',
path : '/1/statuses/public_timeline.json?count=3&include_entities=true'
17:20:31 curr: 18935808 min: 17408000 max: 57626624
17:20:46 curr: 18935808 min: 17408000 max: 57626624
17:21:01 curr: 18935808 min: 17408000 max: 57626624
17:21:16 curr: 18935808 min: 17408000 max: 57626624
17:21:31 curr: 18935808 min: 17408000 max: 57626624
@alejandro
alejandro / mytheme.zsh-theme
Created April 9, 2012 01:09
My oh-my-zsh theme
PROMPT='%{$fg_bold[cyan]%}⢷⡾ %{$fg_bold[green]%}%p /%{$fg[green]%}%c % %{$reset_color%}➔'
RPROMPT='%{$fg_bold[yellow]%}»»»[$(date +%X)]%{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%}%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
@alejandro
alejandro / 1.js
Created February 25, 2012 04:31
Ejemplos
// utilidades.js
var max = module.exports.max = function(array){
var a = array.sort();
return a[a.length-1];
}
var min = module.exports.min = function(array){
var a = array.sort();
return a[0];
}
var unique = module.exports.unique = function(array){