Skip to content

Instantly share code, notes, and snippets.

View Miuler's full-sized avatar
🦀
Mi nueva pacion, Rust!

Hector Miuler Malpica Gallegos Miuler

🦀
Mi nueva pacion, Rust!
View GitHub Profile
/* Este es un ejemplo de fijar un bloque en la esquina superior izquierda, usando css
sacado de la libreria blackbird
Vamos a sacar una de las partes más interesantes, para colocar un bloque siempre a
la esquina superior izquierda:
*/
#blackbird {
z-index:10; margin:0; padding:0; position:fixed; _position:absolute;
font:11px/1.3 Consolas, 'Lucida Console', Monaco, monospace; _border:2px solid #BBB;
// Ext.ux.GMapPanel - Google Maps
// Extensión para ExtJs para crear mapas de google
function open_map(el, evn){
_latitude = 10;
_longitude = -70;
winMap = new Ext.Window({
layout: 'fit',
title: 'Unidad en google maps',
//closeAction: 'hide',
#!/usr/bin/env python
import pygtk
import datetime
import locale
pygtk.require('2.0')
t = 'Fri May 09 02:38:22 +0000 2008'
print datetime.datetime.strptime(t, "%a %b %d %H:%M:%S +0000 %Y")
print datetime.datetime.strftime(datetime.datetime.now(), '%a %b %d %H:%M:%S +0000 %Y')
print locale.getlocale()
@Miuler
Miuler / gist:110343
Created May 12, 2009 06:02
Un widget que crea un a especie de combobox solo que en vers de desplegar una lista, desplega un calendario.
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# vim: ai ts=4 sts=4 et sw=4
# Autor: Hector Miuler Malpica Gallegos
# Email: miuler@gmail.com
# Rev: $Rev
# -------------------------------------------------------------------
import gtk
import datetime
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# vim: ai ts=4 sts=4 et sw=4
# Autor: Hector Miuler Malpica Gallegos
# Email: miuler@gmail.com
# Rev: $Rev
# -------------------------------------------------------------------
"""
Este es un ejemplo de como agegar una método que genere
-- DAR PERMISOS A TODAS LAS TABLA DES UN SCHEMA
-- ============================================
-- Funcion para asigar todos lo privilegios a un usuario
-- para todas las tablas, vistas,
-- que pertenecen aun esquema en particular.
--
-- Esta función te lo resuelve:
CREATE OR REPLACE FUNCTION grant_all_privileges(p_user text, p_schema text)
RETURNS void AS
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@Miuler
Miuler / .vimrc
Created September 21, 2011 13:25
Archivo de configuracion de VIM
" .VIMRC
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" TEMPORAL PARA USAR MIENTRAS USO DARES
au BufWritePost *.js silent! !ctags -R src/main/java src/main/webapp/resources/js/ &
au BufWritePost *.js :TlistUpdate
map ,rr :!rsync -avze ssh /home/miuler/Personal/Clients/Proyectos/gas/ virtuar0@miuler.com:/home1/virtuar0/miuler/www/www/dares/<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@Miuler
Miuler / .ctags
Created January 2, 2012 02:14 — forked from anonymous/.ctags
--langdef=Scala
--langmap=Scala:.scala
--regex-Scala=/^[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/c,classes/
--regex-Scala=/^[ \t]*object[ \t]*([a-zA-Z0-9_]+)/\1/o,objects/
--regex-Scala=/^[ \t]*trait[ \t]*([a-zA-Z0-9_]+)/\1/t,traits/
--regex-Scala=/^[ \t]*case[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/r,cclasses/
--regex-Scala=/^[ \t]*abstract[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/a,aclasses/
--regex-Scala=/^[ \t]*def[ \t]*([a-zA-Z0-9_=]+)[ \t]*.*[:=]/\1/m,methods/
--regex-Scala=/[ \t]*val[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/V,values/
--regex-Scala=/[ \t]*var[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/v,variables/
@Miuler
Miuler / gist:1836786
Created February 15, 2012 15:46 — forked from wspringer/gist:1649700
LZW Encoding *and Decoding* in Scala
object lzw {
trait Appendable[T] {
def append(value: T)
}
import scala.collection.generic._
case class GrowingAppendable[T](growable: Growable[T]) extends Appendable[T] {
def append(value: T) {
growable += value