Skip to content

Instantly share code, notes, and snippets.

View abits's full-sized avatar

Christoph Martel abits

  • Stuttgart, Germany
View GitHub Profile
@abits
abits / trello2burndown.py
Last active February 29, 2016 12:02
trello2burndown
#! python3
import csv
import datetime
import json
import os
import pickle
import sqlite3
BEGIN_OF_SPRINT = datetime.datetime(2016, 2, 21)
@abits
abits / dict_to_object.py
Created February 22, 2016 16:05 — forked from lachezar/dict_to_object.py
Python dict to object
config_dict = {
'group1': {
'server1': {
'apps': ('nginx', 'mysql'),
'cpus': 4
},
'maintenance': True
},
'firewall_version': '1.2.3',
'python2.7': True
@abits
abits / ansible-freebsd-1.yml
Created November 26, 2015 17:20
ansible-freebsd-1
# task for installing Python on a host via raw
- name: install Python
raw: env ASSUME_ALWAYS_YES=YES pkg install Python
@abits
abits / gist:0a5229d57e5c75279cb8
Created August 26, 2015 13:48
Seprate log file in symfony
# app/config/config.yml
services:
energy_label.logger:
class: Symfony\Bridge\Monolog\Logger
arguments: [app]
calls:
- [pushHandler, [@energy_label.logger_handler]]
energy_label.logger_handler:
class: Monolog\Handler\StreamHandler
arguments: [%kernel.logs_dir%/%kernel.environment%.energy_label_error.log, 200]
@abits
abits / gulpfile.js
Last active August 29, 2015 14:23 — forked from insin/gulpfile.js
var gulp = require('gulp')
var shell = require('gulp-shell')
gulp.task('build-docs', shell.task('make html', {cwd: './docs'}))
gulp.task('docs', ['build-docs'], function() {
gulp.watch(['./docs/*.rst', './docs/*.py'], ['build-docs'])
})
Exercise: Nutrition Facts
Create an empty webpage.
Download nutrition.xml from https://gist.github.com/3000322 and place in your project folder.
Use AJAX via jQuery or JS API to fetch the file into the page.
Create a table. For each <food> in the XML file, create a row in the table with the food name and nutritional facts - serving size, calories, carbs.
Bonus: Use the tablesorter jQuery plugin to make the table sortable by the nutritional facts.
Exercise: Lady Gaga News
@abits
abits / gulpfile.js
Last active August 29, 2015 14:21 — forked from mlouro/gulpfile.js
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@abits
abits / gulpfile.js
Last active August 29, 2015 14:21 — forked from Raynos/gulpfile.js
/*
This is an EXAMPLE gulpfile.js
You'll want to change it to match your project.
Find plugins at https://npmjs.org/browse/keyword/gulpplugin
*/
var gulp = require('gulp');
var uglify = require('gulp-uglify');
gulp.task('scripts', function() {
// Minify and copy all JavaScript (except vendor scripts)
@abits
abits / gist:60423cf31d3a55c455b7
Created March 27, 2015 22:35
post-receive hook with build task
#!/sbin/sh
GIT_WORK_TREE=/srv/http/www.hjkl.org git checkout -f
cd /srv/http/www.hjkl.org && make html
'''
Credit to Adam Presley, who's ftpsyncing fabfile I used as a starting point
http://adampresley.com/#!post/2013/04/how-i-deployed-a-php-app-via-ftp-using-fabric-and-git
'''
import fabric
import ftplib
import re
import os
from git import *
from ftplib import FTP