Skip to content

Instantly share code, notes, and snippets.

View neosergio's full-sized avatar
🤓
Happy Coding!

Sergio Infante neosergio

🤓
Happy Coding!
View GitHub Profile
@neosergio
neosergio / gui
Created June 14, 2012 01:42
interfaz gráfica de ejemplo de Tkinter con Python
#-*- coding:utf-8 -*-
from Tkinter import *
#funciones de procesamiento
def procesar():
resultado = peso.get() + altura.get()
print resultado
#Instancia de la clase Tk
ventana = Tk()
@neosergio
neosergio / nuevo_documento.html
Created July 24, 2012 22:20
Ejemplo de plantilla Django con Javascript
{% extends 'base.html' %}
{% block titulo %}Agregar o editar nuevos trabajos {% endblock %}
{% block css %}
<link href='/static/css/south-street/jquery-ui-1.8.16.custom.css' rel='stylesheet'>
{% endblock %}
{% block javascript %}
<script src='/static/js/jquery-1.6.2.min.js'></script>
<script src='/static/js/jquery-ui-1.8.16.custom.min.js'></script>
<script src='/static/js/jquery.ui.datepicker-es.js'></script>
<script src='/static/js/legolax.js'></script>
@neosergio
neosergio / js_confirmar
Created July 24, 2012 22:21
Confirmar cambios Modal windows
/* Dialogo para confirmar cambios */
$(document).ready(function(){
// Formateamos el botón Diálogo sencillo
$('#dialogSencillo').button();
// Damos formato a la Ventana de Diálogo
$('#dialogo').dialog({
// Indica si la ventana se abre de forma automática
autoOpen: false,
// Indica si la ventana es modal
modal: true,
@neosergio
neosergio / gist:4453696
Last active December 10, 2015 15:19
Just fun
[[171108522930776]]
[[168456309878025]]
[[164413893600463]]
[[189637151067601]]
[[218595638164996]]
[[106043532814443]]
[[189637151067601]]
[[214457085240151]]
[[129627277060203]]
[[160723207280093]]
@neosergio
neosergio / gist:4589636
Created January 21, 2013 21:32
Just for fun in accordion functionality
//playing with collapsibles areas
$(document).ready(function(){
$("[data-toggle='collapse']").click(function(e){
var $this = $(this);
var $icon = $this.find("i[class^='icon-chevron']");
console.log('llega');
if ($icon.hasClass('icon-chevron-right')){
$icon.removeClass('icon-chevron-right').addClass('icon-chevron-down');
} else {
$icon.removeClass('icon-chevron-down').addClass('icon-chevron-right');
git diff --no-prefix --ignore-space-at-eol | sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" > changes.patch
@neosergio
neosergio / virtualenwrapper-profile
Last active December 19, 2015 17:28
This is useful when you want to have many versions of python libraries, you can add this lines into ~/.profile
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/directory-you-do-development-in
source /usr/local/bin/virtualenvwrapper.sh
@neosergio
neosergio / script-magico.sh
Last active December 21, 2015 21:29
example of a small script to install an specific environment for a project
#update the operating system
sudo apt-get update --yes
sudo apt-get upgrade --yes
sudo apt-get dist-upgrade --yes
#this is for using our active directory
sudo apt-get install likewise-open5 --yes
#tasksel magic
sudo apt-get install tasksel --yes
@neosergio
neosergio / imagen_en_contenedor.rb
Last active January 1, 2016 16:39
Jugando con Ruby: Algoritmo simple sobre un contenedor y una imagen que se ajusta al tamaño del contenedor dinamicamente
puts "De las siguientes opciones del tamaño del contenedor"
puts "1 - Ancho contenedor 200 - Alto contenedor 100"
puts "2 - Ancho contenedor 100 - Alto contenedor 200"
puts "3 - Dejame ingresar los valores manualmente del contenedor"
print "Elija su preferencia: "
STDOUT.flush
opcion = gets.to_i
if opcion == 1
ancho_contenedor = 200
alto_contenedor = 100
@neosergio
neosergio / reinstall-mbanking.sh
Last active August 29, 2015 14:05
Bash script to quick reinstall of a mbanking server
#!/bin/bash
cd ~
rm *.property*
wget https://gist.githubusercontent.com/neosergio/76b91816239f9cdab3d8/raw/74112f73280d9ce339fb32e3be30f169ccb2f252/mbanking-database-install.property
wget https://gist.githubusercontent.com/neosergio/6ab217e00fde9380c219/raw/b3c1d781585f1ea2eaee94c73ee9cd9972a61fd9/mbanking-configuration-install.property
wget https://gist.githubusercontent.com/neosergio/790f851cce9785815fd5/raw/aa109702a9ecfb7db22306f9a2d2d94f1568af20/mbanking-server-install.property
wget https://gist.githubusercontent.com/neosergio/87df7af335a65912fadc/raw/fafc8477fcc17f54c916c36a26330a1ed577cb61/mb-testharness-database.property
wget https://gist.githubusercontent.com/neosergio/8c218258c1e28e4c43dc/raw/3f21574ae03da2cac58dc6285aada88dd83eb9a6/mb-testharness-server.property
while getopts ":m:f:d" opt; do
case $opt in