Skip to content

Instantly share code, notes, and snippets.

View merqurio's full-sized avatar

Gabi Maeztu merqurio

View GitHub Profile
@merqurio
merqurio / app.yaml
Last active August 29, 2015 14:14 — forked from darktable/app.yaml
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@merqurio
merqurio / git-commands.sh
Last active August 29, 2015 14:15
Git server setup
# --------------------------------------
# Get a new repository
git clone [email protected]:*project*
# See the actual branch and modified files
git status
# Create a branch
git branch *branch name*
@merqurio
merqurio / check-all.js
Created February 26, 2015 08:23
JS snippet to toggle all checkboxes in a table
function toggle(source) {
checkboxes = document.getElementsByName('foo');
for(var i=0, n=checkboxes.length;i<n;i++) {
checkboxes[i].checked = source.checked;
}
}
@merqurio
merqurio / theme_alt.css
Created March 15, 2015 22:50
Jupyter Notebook CSS
/* nbextensions/theme_alt.css */
/*
CODEMIRROR CURSOR
*/
.CodeMirror div.CodeMirror-cursor {
border-left: 2px solid #268bd2;
z-index: 3;
}
@merqurio
merqurio / dinamic_circle.ipynb
Last active September 27, 2015 00:11
dinamic circle
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
file = open('../DS07/files/2002FemPreg.dat', 'r')
def chr_int(a):
if a == ' ':
return 0
else:
return int(a)
preg=[]
@merqurio
merqurio / x2retina.md
Created December 10, 2015 18:55
Retina graphics for Mac OSX Macbook Pro retina in ipython / jupyter notebooks

%config InlineBackend.figure_format = 'retina'

@merqurio
merqurio / chord_test.py
Created January 12, 2016 08:29
Example chord graph using bokeh
import numpy as np
import pandas as pd
from bokeh.charts import output_file, show, Chord
from bokeh.sampledata.les_mis import data
nodes = data['nodes']
names = [node['name'] for node in sorted(data['nodes'], key=lambda x: x['group'])]
N = len(nodes)
counts = np.zeros((N, N))
@merqurio
merqurio / root_logger_settings.py
Created February 11, 2016 21:35 — forked from st4lk/root_logger_settings.py
Python logging settings for root logger
"""
Settings for root logger.
Log messages will be printed to console and also to log file (rotated, with
specified size). All log messages from used libraries will be also handled.
Three approaches for defining logging settings are used:
1. using logging classes directly (py25+, py30+)
2. using fileConfig (py26+, py30+)
3. using dictConfig (py27+, py32+)
Choose any variant as you like, but keep in mind python versions, that
@merqurio
merqurio / wordpress_backup.sh
Last active June 13, 2016 13:57
A script to create wordpress/SQL site backups
#!/bin/bash
NOW=$(date +"%Y-%m-%d-%H%M")
WWW_DIR=""
DB_USER=""
DB_PASS=""
DB_NAME=""
DB_HOST=""
BACK_DIR="/root/back/$DB_NAME"