This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p reports | |
REPO="http://127.0.0.1:8888" | |
echo Checking for local repo at ${REPO} | |
curl -f --head ${REPO} > /dev/null 2>&1 || REPO='http://pypi.python.org/simple' | |
echo "... will use ${REPO}" | |
echo 'Creating "venv" environment...' | |
virtualenv --distribute --no-site-packages venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <groove/groove.h> | |
#include <limits.h> | |
//compile with gcc -o waveform main.c -O3 -lgroove -std=c99 | |
// Define a vector type | |
typedef struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from __future__ import unicode_literals | |
from __future__ import print_function | |
from __future__ import absolute_import | |
from __future__ import division | |
from django.utils.encoding import python_2_unicode_compatible | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() | |
{ | |
cat << EOF | |
usage: $0 options | |
This script set ownership for all table, sequence and views for a given database | |
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dependency - Function.prototype.bind or underscore/lodash | |
app = angular.module 'someApp' | |
class @BaseCtrl | |
@register: (app, name) -> | |
name ?= @name || @toString().match(/function\s*(.*?)\(/)?[1] | |
app.controller name, @ | |
@inject: (args...) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var BatchStream = require('batch-stream2') | |
var gulp = require('gulp') | |
var coffee = require('gulp-coffee') | |
var uglify = require('gulp-uglify') | |
var cssmin = require('gulp-minify-css') | |
var bower = require('gulp-bower-files') | |
var stylus = require('gulp-stylus') | |
var livereload = require('gulp-livereload') | |
var include = require('gulp-include') | |
var concat = require('gulp-concat') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import fcntl | |
import optparse | |
import os | |
import progressbar | |
import re | |
import select | |
import shlex | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import random | |
import string | |
def seq_gen(length=5, uppercase=True, lowercase=True, digits=True, | |
special=True, extra=None): | |
""" | |
Returns the sequence of given length consists of specified | |
group of chars: digits, uppercase, lowercase, punctuation or | |
custom set. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FormData(object): | |
""" | |
The object with dictionary of data | |
""" | |
data = {} | |
def as_dict(self, fields=None, exclude=None, override={}): | |
if fields is not None: | |
return dict([(f, self.data[f]) for f in fields]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PoolBase(object): | |
def __init__(self): | |
self.item_stack = [] | |
def register(self, item): | |
if not self.check_type(item): | |
raise TypeError, 'The {item} can\'t be registered in {class_name}'.format( | |
class_name = self.__class__, | |
item = item.__class__) |
OlderNewer