Skip to content

Instantly share code, notes, and snippets.

View gist:74659
public List<TableroControlTO> obtenTableroColegio(int cveunidad, int subgrupo, String anio) {
List<TableroControlTO> unidades = new ArrayList<TableroControlTO>();
Connection con = null;
try {
con = getDataSource().getConnection();
PreparedStatement pstm = con.prepareStatement("SELECT * FROM sistema.tableroestatal(?, ?, ?)");
pstm.setInt(1, cveunidad );
pstm.setInt(2, subgrupo);
View gist:1142547
$ 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
@jeduan
jeduan / reveal_ajax.js
Created Feb 9, 2012
Use Zurb reveal with ajax
View reveal_ajax.js
$('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();
});
});
@jeduan
jeduan / postcard-responsive.html
Created May 21, 2012
Responsive email template
View postcard-responsive.html
<!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 / Gemfile
Created Sep 13, 2012
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
View Gemfile
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
View mysql2sqlite.sh
#!/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 / apps_script_followers.md
Last active Dec 13, 2015
Made these quick functions to get the number of twitter followers and klout score of a given twitter username on Google Spreadsheets
View apps_script_followers.md

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)

@jeduan
jeduan / gist:5718179
Created Jun 5, 2013
schema.json Este schema me genero este sitio, @ruycer
View gist:5718179
{
"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 / segundamano.js
Last active Dec 20, 2015
Busqueda de departamentos con vanilla js
View segundamano.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 / .bowerrc
Last active Dec 20, 2015
We use a bower based registry for our lua packages. These are the steps to get it working
View .bowerrc
{
"directory": "vendor",
"registry": "https://yogome-bower.herokuapp.com"
}