Skip to content

Instantly share code, notes, and snippets.

@Guitlle
Guitlle / copylista.py
Last active May 8, 2021 02:59
Copiar cada item de una lista de textos al portapapeles
# Para utilizar se puede correr este comando, luego se pega la lista de textos y
# luego se presiona ctrl+d para terminar de ingresar la lista y correr el programa
# El programa abre una ventana con un botón. Cada vez que se presiona ese botón
# se copia en el portapapeles o clipboard el próximo texto de la lista
#
# cat | python3 copylista.py
# >linea1
# >linea2
# >CTRL+D
@Guitlle
Guitlle / access2csv.py
Last active June 23, 2022 10:06
Access to csv exporter with UCanAccess.
"""
This script exports all tables in a MSAccess file to a bunch of CSV's.
It depends on UCanAccess binaries, which can be downloaded from here:
http://ucanaccess.sourceforge.net/site.html
It supports MSAccess 2016 and previous versions.
Make sure to set pathUCA to the path of the UCanAccess binaries.
"""
from subprocess import Popen, PIPE, STDOUT
import io
@Guitlle
Guitlle / json2csv.php
Last active March 6, 2018 23:46
Convert a list of json strings to csv in PHP
<?php
/*
author: Guillermo <[email protected]>
This converst a list of jsons to a csv string. JSON names
are built with the key names and points. See example below.
It basically flattens associative arrays with a recursive function
and then merges all these flattened arrays.
@Guitlle
Guitlle / Dockerfile
Created August 28, 2015 23:47
Bonefish dockerfile
FROM ubuntu:14.04
ENV src /src
WORKDIR ${src}
RUN apt-get update; apt-get install git build-essential -y
RUN apt-get install -y cmake libboost-all-dev libmsgpack-dev
RUN git clone --recursive https://github.com/tplgy/bonefish.git
RUN mkdir bonefish-build && cd bonefish-build; cmake ../bonefish
RUN cd bonefish-build/; make; make install
CMD ["bonefish-build/daemon/bonefish", "--realm", "\"default\"", "--websocket-port", "9999"]
@Guitlle
Guitlle / pieChartFromObject.js
Created April 22, 2014 21:33
Sparkline pie chart from object. the tooltips are the object keys and the values are the object value for each key.
function pieChartFromObject(data, options, className) {
var labels = [], total = 0,
values = $.map(data, function(value, label) { total += value; labels.push(label); return value; });
var chart = $('<span class="'+className+'">&nbsp;</span>');
options.type = 'pie';
options.tooltipFormat = '<span style="color: {{color}}">&#9679;</span> {{offset:labels}} - {{value}} ({{percent.1}}%)';
options.tooltipValueLookups = { labels: labels} ;
if (total == 0) {
@Guitlle
Guitlle / python_resources.md
Created March 15, 2014 22:33 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@Guitlle
Guitlle / javascript_resources.md
Created March 15, 2014 22:33 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@Guitlle
Guitlle / 0_reuse_code.js
Created March 15, 2014 22:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Guitlle
Guitlle / gscope.c
Created April 18, 2013 22:48
Osciloscopio para la launchpad MSP430 con el chip msp430g2553. Tiene 8 velocidades y funciona vía el puerto seria (UART) para que funcione deben voltear los JUMPERs que dicen TX y RX (hardware uart). A 9600 baudios por segundo, se le envía un caracter y la launchpad responde con 200 datos obtenidos mediante el ADC . Requiere que el cristal que t…
#include "msp430g2553.h"
#include "stdbool.h"
#define LED BIT6
#define RXD BIT1
#define TXD BIT2
unsigned int i; // for loop variable
volatile unsigned char rx_flag = 0;
volatile unsigned char tx_flag = 0;