Skip to content

Instantly share code, notes, and snippets.

View jeduan's full-sized avatar

Jeduan Cornejo jeduan

View GitHub Profile
@jeduan
jeduan / database.lua
Created January 20, 2014 18:20
Creating a model that renders itself in corona
local modeloEspecial = ModeloEspecial:new {
name = "yogodb",
debug = settings.debugSql
}
local function migrate(schemaVersion, exec)
if schemaVersion < 1 then
log "migrating schema to v1"
local createPlayers = [[CREATE TABLE IF NOT EXISTS players (
@jeduan
jeduan / .bowerrc
Last active December 20, 2015 16:48
We use a bower based registry for our lua packages. These are the steps to get it working
{
"directory": "vendor",
"registry": "https://yogome-bower.herokuapp.com"
}
@jeduan
jeduan / segundamano.js
Last active December 20, 2015 16:29
Busqueda de departamentos con vanilla js
(function(){
//Configuration
var colonias = 'Roma Norte,Roma Sur,Cuauhtémoc,Juárez,Del Valle Norte,Narvarte Oriente,Narvarte Poniente,Letrán Valle,Del Valle Sur,Piedad Narvarte,Del Valle Centro,San Pedro de los Pinos,Vertiz Narvarte'.split(',');
var sinBusco = true;
var util = {
$$: function(selector) {
return [].slice.call(document.querySelectorAll(selector))
},
@jeduan
jeduan / gist:5718179
Created June 5, 2013 23:36
schema.json Este schema me genero este sitio, @ruycer
{
"type":"object",
"$schema": "http://json-schema.org/draft-03/schema",
"id": "http://jsonschema.net",
"required":false,
"properties":{
"pollutionMeasurements": {
"type":"object",
"id": "http://jsonschema.net/pollutionMeasurements",
"required":true,
@jeduan
jeduan / apps_script_followers.md
Last active December 13, 2015 17:49
Made these quick functions to get the number of twitter followers and klout score of a given twitter username on Google Spreadsheets

Made these quick functions to get the number of twitter followers and klout score of a given twitter username.

Supports both @username and username as input.

To use them you have to create a Google Drive Spreadsheet and then go to Tools -> Script Editor, and then paste one or both Then the functions will be available as normal functions and you can use them as =followers(CELL_OR_SCREENNAME) and =klout(CELL_OR_SCREENNAME)

#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@jeduan
jeduan / Gemfile
Created September 13, 2012 17:01
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@jeduan
jeduan / postcard-responsive.html
Created May 21, 2012 21:36
Responsive email template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<!-- Facebook sharing information tags -->
<meta property="og:title" content="*|MC:SUBJECT|*" />
<title>*|MC:SUBJECT|*</title>
@jeduan
jeduan / reveal_ajax.js
Created February 9, 2012 00:15
Use Zurb reveal with ajax
$('a.reveal').click(function(event) {
event.preventDefault();
var $div = $('<div>').addClass('reveal-modal').appendTo('body'),
$this = $(this);
$.get($this.attr('href'), function(data) {
return $div.empty().html(data).append('<a class="close-reveal-modal">&#215;</a>').reveal();
});
});
$ dmesg
:0: [sda] Unhandled error code
[327491.642630] sd 0:0:0:0: [sda] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[327491.642636] sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 f8 c0 c7 00 00 08 00
[327491.642648] end_request: I/O error, dev sda, sector 16302279
[327491.646981] type=1505 audit(1313152772.682:1388): operation="profile_replace" pid=31237 name="/usr/sbin/mysqld"
[327521.806796] sd 0:0:0:0: [sda] Unhandled error code
[327521.806800] sd 0:0:0:0: [sda] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[327521.806806] sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 f8 c0 c7 00 00 08 00
[327521.806818] end_request: I/O error, dev sda, sector 16302279