Skip to content

Instantly share code, notes, and snippets.

View samuell's full-sized avatar
💻
Hacking away

Samuel Lampa samuell

💻
Hacking away
View GitHub Profile
package main
import (
"bufio"
"fmt"
"log"
"os"
)
func main() {
@samuell
samuell / luigi_params_mixin.py
Created June 4, 2014 16:11
Snippet showing how to define (and pass on) workflow-wide parameters in the luigi workflow system. Courtesy of Joe Ennever ("stolen" from https://groups.google.com/forum/#!msg/luigi-user/7zIS_qseNOM/TWcYtRe5SVoJ )
class FooParamsMixin(object):
param1 = luigi.Parameter()
param2 = luigi.Parameter()
...
def foo_params(self):
return { 'param1': self.param1, 'param2' : self.param2, ... }
class TaskA(FooParamsMixin, luigi.Task):
def requires(self):
[formatters]
keys: default
[handlers]
keys: console, logfile
[loggers]
keys: root, luigi-interface
[formatter_default]
class TaskA1(luigi.Task):
def requires(self):
....
def output(self):
return { 'output1' : luigi.LocalTarget( self.input().path + ".output1" ),
'output2' : luigi.LocalTarget( self.input().path + ".output2" ) }
def run(self):
....
class TaskA2(luigi.Task):
#!/bin/bash
sudo apt-get install \
libgtk2.0-0:i386 \
libpangox-1.0-0:i386 \
libpangoxft-1.0-0:i386 \
libstdc++5:i386
@samuell
samuell / googlefonts_logo.txt
Created June 19, 2014 22:15
Nice Google fonts for use in logos
Anton
Black Ops One
Coda
Ek Mukta
Exo
Exo 2
Fira Sans
Merriweather Sans
Open Sans
Orbitron
# Install some essential development tools
sudo apt-get install gnome-terminal vim git tig curl subversion
# Installing the basics of a LAMP server
sudo apt-get install apache2 mysql-server php5
# Installing the "connections" between the packages
sudo apt-get install libapache2-mod-php5 php5-mysql
# Various extra stuff for
from ConfigParser import ConfigParser
# WRITE FILE
conf = ConfigParser()
conf.add_section('rmsd_info')
conf.set('rmsd_info','rmsd',1.123)
with open('rmsd.info','w') as outfile:
conf.write(outfile)
# READ FILE
@samuell
samuell / simple_timestamp.py
Created July 4, 2014 13:42
How to output a simple formatted date / time stamp in python
import time
# Will output something like:
# 20140704 15:40:51
time.strftime('%Y%m%d %H:%M:%S')
  • Added the following lines, according to /etc/php5/apache2/conf.d/20-xdebug.ini
debug.remote_host= 127.0.0.1
xdebug.remote_port=9000
xdebug.max_nesting_level=200
xdebug.remote_enable=1
xdebug.idekey="PHPSTORM"
xdebug.remote_autostart = 1
  • Restarted apache: