Skip to content

Instantly share code, notes, and snippets.

View comtom's full-sized avatar

Tomás Dowling comtom

View GitHub Profile
@comtom
comtom / Example Django AJAX view
Last active August 29, 2015 13:57
Example Django AJAX view
def getSomething(request):
""" get something model in a format that fullcalendar can read """
userId = request.user
somethingList = Something.objects.filter(something__user__id=userId)
results = []
for something in somethingList:
something_dict = {'id':something.id, 'title':something.title, 'start':str(something.startdate), 'end':str(something.enddate), 'allDay':True, 'editable':True }
results.append(something_dict)

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

package pack;
public class Alumno {
private String nombre;
private String apellido;
private int edad;
public Alumno(String nombre, String apellido, int edad){
this.nombre = nombre;
this.apellido = apellido;
package turcobomber;
public class TurcoBomber {
public static void main(String[] args) {
System.out.println("Alumnos instanciados:");
// crea los objetos
pack.Alumno tomy = new pack.Alumno("Tomas", "Gonzalez Dowling", 28);
pack.Alumno flaco = new pack.Alumno("Juan", "Gonzalez Soler", 21);
@comtom
comtom / dropdown-example
Last active August 29, 2015 14:05
dropdown - ajax
/*
----------------------------
PARTIDOS
----------------------------
*/
// trae partidos segun el departamento
case 'partidos':
$departamento = (!empty($_GET['departamento'])) ? ms_escape_string($_GET['departamento']) : "0";
$sql = "SELECT distinct P.PARTIDO, P.DESCRIPCION
@comtom
comtom / show_sum
Created November 4, 2014 17:49
example call a routine and show the result
section .text
global _start ;must be declared for using gcc
_start: ;tell linker entry point
mov ecx,'4'
sub ecx, '0'
mov edx, '5'
sub edx, '0'
call sum ;call sum procedure
mov [res], eax
@comtom
comtom / CASA
Created December 3, 2014 15:15
//Ejercicio 2P2014-E02B;
// Dado un árbol n-ario de caracteres, determinar mediante
// una función si algún nodo formaba con sus hijos
// exactamente la palabra C A S A (en ese orden).
function busCasa(p:posicion; A:tArbol):boolean;
var
c: posicion;
casa: string;
# -*- coding: utf-8 -*-
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Tomas', 'tomas@comtomtech.com'),
)
MANAGERS = ADMINS
@comtom
comtom / Proxy Atom 1.0
Last active August 29, 2015 14:23
Configurar proxy en Atom 1.0
Configurar proxy en Atom 1.0
sistemas@webmaster /cygdrive/c/Users/sistemas/AppData/Local/atom/app-1.0.0/resources/app/apm/bin
$ ./apm.cmd config set https_proxy 'http://192.168.0.103:3128'
sistemas@webmaster /cygdrive/c/Users/sistemas/AppData/Local/atom/app-1.0.0/resources/app/apm/bin
$ ./apm.cmd config set http_proxy 'http://192.168.0.103:3128'
sistemas@webmaster /cygdrive/c/Users/sistemas/AppData/Local/atom/app-1.0.0/resources/app/apm/bin
$ ./apm.cmd config set proxy 'http://192.168.0.103:3128'
#!/bin/sh
# firewire device (dv cam or twinpact)
# ====================================
# dvsource-dvgrab - collects parameters from command line and config files, connects stdout to dvswitch, shells out to dvgrab which sends dv stream to stdout, thus dvswitch.
#
# The use running dvsource-dvgrab will need read/write permission on the /dev/raw1394 node. This can be done by putting both in the video group:
#
# # /etc/udev/rules.d/91-permissions.rules
# # ieee1394 devices