Skip to content

Instantly share code, notes, and snippets.

View alejandro's full-sized avatar

Alejandro Morales alejandro

  • Revls
  • Tegucigalpa, Honduras
View GitHub Profile
@alejandro
alejandro / Reverse
Created January 9, 2011 02:55
Reverse
My First app en Sinatra...
@alejandro
alejandro / common.js
Created August 21, 2011 15:21
Snippet to connect to your REDIS TO GO instance
var redis = require('redis');
var createRedisClient = function() {
var db = redis.createClient(INSERT_PORT, HOST);
var dbAuth=function() { db.auth('PASSWORD');};
db.addListener('connected',dbAuth);
db.addListener('reconnected',dbAuth);
dbAuth();
return db;
};
@alejandro
alejandro / ubuntu
Created August 22, 2011 22:12
Getting ready for a developer machine. Ubuntu
#!/usr/bin/env bash
echo "Checking for SSH key, generating one if it exists ..."
[[ -f ~/.ssh/id_rsa.pub ]] || ssh-keygen -t rsa
echo "Copying public key to clipboard. Paste it into your Github account ..."
[[ -f ~/.ssh/id_rsa.pub ]] && cat ~/.ssh/id_rsa.pub | xclip
open https://github.com/account/ssh
echo "Using apt-get to install OS packages so let's update it first ..."
@alejandro
alejandro / README.markdown
Created September 2, 2011 19:55
How-To Recover Files from failed Wubi with LiveCD (.disk files)

Boot your computer, enter your BIOS by pressing the key it tells you to press at the first splash screen you come to at startup, put the CD/DVD drive first in the boot sequence, insert your LiveCD, then save the changes, and exit your BIOS. Your computer should now boot from the CD. In the Ubuntu setup program, select the preferred language you use, then select the "Try Ubuntu with No Change To My Computer" option. Once at the Ubuntu desktop, in a Live session, open up Applications->Accessories>Terminal.

Run:

  • % sudo fdisk -l
  • % sudo mkdir /win
  • % sudo mount /dev/sdxy /win
@alejandro
alejandro / random.js
Created September 3, 2011 22:17
Generar random ID's
var letra = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
var letra_o_numero,
numero=0,
string="";
function id() {
for(i=0;i<=5;i++){
letra_o_numero = Math.floor(Math.random(5)*2);
//si es 1, que el string sea una letra
if (letra_o_numero == 1){
@alejandro
alejandro / ajaxify-html5.js
Created September 21, 2011 01:13 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
// Check to see if History.js is enabled for our Browser
@alejandro
alejandro / dummy.json
Created September 27, 2011 04:01
Dummy Json
{
"video": [
{
"id": "12312412312",
"name": "Ecuaciones Diferenciales",
"url": "/video/math/edo/12312412312",
"author": {
"data": [
{
"name_author": "Alejandro Morales",
@alejandro
alejandro / jitsu.log
Created October 4, 2011 00:54
log from jitsu
>sudo npm install jitsu -g
npm ERR! Failed unpacking /home/alejandromg/.npm/cliff/0.1.5/package.tgz
npm ERR! error installing cliff@0.1.5 Error: `tar "-zmvxpf" "/home/alejandromg/.npm/cliff/0.1.5/package.tgz" "-C" "/usr/local/lib/node_modules/jitsu/node_modules/___cliff.npm" ["-o"]`
npm ERR! error installing cliff@0.1.5 failed with 2
npm ERR! error installing cliff@0.1.5 at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/tar.js:182:20)
npm ERR! error installing cliff@0.1.5 at ChildProcess.emit (events.js:67:17)
npm ERR! error installing cliff@0.1.5 at Socket.<anonymous> (child_process.js:179:12)
npm ERR! error installing cliff@0.1.5 at Socket.emit (events.js:64:17)
npm ERR! error installing cliff@0.1.5 at Array.7 (net.js:837:12)
npm ERR! error installing cliff@0.1.5 at EventEmitter._tickCallback (node.js:126:26)
@alejandro
alejandro / jitsu.log
Created October 4, 2011 01:06
New jistu log
npm ERR! error installing loggly@0.3.8 Error: shasum check failed for /tmp/npm-1317690078630/1317690275461-0.9789524883963168/tmp.tgz
npm ERR! error installing loggly@0.3.8 Expected: af231fe87e3725a5db46ff74833f3aa0ebfd9151
npm ERR! error installing loggly@0.3.8 Actual: 7a9f8717c8701d7e495e6f8218cc05bcc6bec4e2
npm ERR! error installing loggly@0.3.8 at /usr/local/lib/node_modules/npm/lib/utils/sha.js:25:20
npm ERR! error installing loggly@0.3.8 at [object Object].<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/sha.js:49:5)
npm ERR! error installing loggly@0.3.8 at [object Object].emit (events.js:61:17)
npm ERR! error installing loggly@0.3.8 at afterRead (fs.js:878:12)
npm ERR! error installing loggly@0.3.8 at wrapper (fs.js:245:17)
npm ERR! error installing winston@0.5.3 Error: shasum check failed for /tmp/npm-1317690078630/1317690275461-0.9789524883963168/tmp.tgz
npm ERR! error installing winston@0.5.3 Expected: af231fe87e3725a5db46ff74833f3aa0ebfd9151
@alejandro
alejandro / jitsu.log
Created October 7, 2011 20:54
Jitsu Log
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Authenticated as alejandromg3
info: Analyzing your application dependencies in app.js
warn: Creating new snapshot for version 0.5.1-1
info: Done creating snapshot 0.5.1-1
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
info: Nodejitsu not ok