Skip to content

Instantly share code, notes, and snippets.

View SuzanaK's full-sized avatar

Suzana K. SuzanaK

View GitHub Profile
@SuzanaK
SuzanaK / Useful entries in .bashrc (Ubuntu)
Created January 22, 2013 00:26
Useful entries in .bashrc
# do not save commands in history that are pwd or clear or that have only one or two letters or that are duplicates
export HISTIGNORE="pwd:clear:?:??:&"
# do not save sequences of duplicates or commands starting with a space
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=100000
@SuzanaK
SuzanaK / Download from Springer via Proxy
Last active December 11, 2015 15:58
Download from the new Springer Link Website via University Proxy
# download Springer Link Books via University Proxy and add the ".pdf" file ending
export http_proxy="http://proxy.zfn.uni-bremen.de:3128";
wget -r -l 1 --reject html,js,css,jpg,png --proxy-user STUD_IP_USERNAME --proxy-passwd STUD_IP_PASSWORD LINK_TO_BOOK;
for i in link.springer.com/content/pdf/*;
do j=`echo $i | cut -f 1`; j=$j".pdf";
@SuzanaK
SuzanaK / html5_canvas_minimal_example.html
Created March 3, 2013 05:40
HTML5 Canvas Minimal Excample
<script>
var canvas = document.getElementById('mycanvas');
var ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.moveTo(startX, startY);
ctx.lineCap = 'round';
ctx.lineWidth = 3;
var red = (((Math.random() * 64) + 128) >> 0);
@SuzanaK
SuzanaK / color_names.py
Created March 14, 2013 16:04
get closest colorname for an RGB color or a list of image files
import colorific
fixed_colors = {
"red" : (255, 0, 0),
'green' : (0, 255, 0),
'blue' : (0, 0, 255),
'orange' : (255, 127, 0),
'pink' : (255, 0, 127),
@SuzanaK
SuzanaK / gnome_snippets
Last active December 15, 2015 10:28
Gnome Snippets
# disable automount of media like DVD, SD Card etc.
gsettings set org.gnome.desktop.media-handling automount false
@SuzanaK
SuzanaK / Python_Code_Snippets
Last active February 12, 2017 20:28
Python Snippets
# various Python code snippets
@SuzanaK
SuzanaK / NLTK code snippets
Created March 26, 2013 14:00
NLTK Code Snippets
# various NLTK code snippets
@SuzanaK
SuzanaK / allinone_cl_download.py
Last active January 12, 2022 03:37
Using the ColourLovers API, these scripts will download all pattern image files (200 x 200 pixel, no repetition), palettes or colors that were created by a specific user. Usage: python cl_image_download.py USERNAME Until now, this script was only tested on a Linux system. After downloading, the image files will be in a directory called "images_U…
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib, urllib2, sys, os, time, json, codecs, requests, logging
import unicodecsv as csv
logging.basicConfig(level=logging.INFO)
CL_COLORS = 0
@SuzanaK
SuzanaK / bibelbücher_json
Last active December 30, 2015 21:29
JSON
{"1. Korinther": 46, "Habakuk": 35, "Epheser": 49, "2. Timotheus": 55, "Haggai": 37, "1. Samuel": 9, "Johannes": 43, "Jona": 32, "Daniel": 27, "Zephanja": 36, "1. Petrus": 60, "2. Chronika": 14, "Ruth": 8, "Judas": 65, "1. Mose": 1, "Esther": 17, "Jakobus": 59, "Maleachi": 39, "1. Johannes": 62, "Klagelieder": 25, "2. Mose": 2, "Kolosser": 51, "2. Korinther": 47, "1. Könige": 11, "Prediger": 21, "Micha": 33, "Philipper": 50, "Galater": 48, "Josua": 6, "Markus": 41, "Joel": 29, "Lukas": 42, "Hohes Lied": 22, "Jeremia": 24, "Hosea": 28, "Hiob": 18, "1. Timotheus": 54, "Psalm": 19, "2. Thessalonicher": 53, "Nehemia": 16, "5. Mose": 5, "Amos": 30, "Obadja": 31, "Apostelgeschichte": 44, "1. Chronika": 13, "Richter": 7, "4. Mose": 4, "Nahum": 34, "Matthäus": 40, "Römer": 45, "Sprüche": 20, "3. Johannes": 64, "Jesaja": 23, "Hesekiel": 26, "Hebräer": 58, "Sacharja": 38, "Titus": 56, "Philemon": 57, "Esra": 15, "Offenbarung": 66, "2. Könige": 12, "3. Mose": 3, "2. Johannes": 63, "2. Samuel": 10, "2. Petrus": 61, "1. T
@SuzanaK
SuzanaK / README.md
Created February 11, 2014 04:39 — forked from tommaybe/LICENSE.md

Inspired by Trulia Trends - but with code and using SVG.

Example data shows concurrent user sessions over time, taken from a development environment.