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 time | |
import sqlite3 | |
import sqlalchemy | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import Column, Integer, String, create_engine | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
Base = declarative_base() | |
DBSession = scoped_session(sessionmaker()) |
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 | |
# Note this requires git compiled with USE_LIBPCRE | |
# to be able to use -P to git grep. | |
# And currently for some reason the regexp causes a segmentation fault | |
# when searching for some functions. | |
NCORES=`grep -c ^processor /proc/cpuinfo` |
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 | |
br=`pwgen -n 5 -c 1` && git checkout -b $br && echo $br >> file && git commit -am"$br" && git push critic $br:r/$br |
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
[alias] | |
fixup = !sh -c 'git commit -a --fixup=`git rev-list master.. | tail -1` && git commit --amend -m\"`git show -s --format=%s`\" -m\"$1\"' - |
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 urllib2 | |
import re | |
import sys | |
import getpass | |
# FILL IN | |
username = "test" | |
passwd = getpass.getpass("Enter password for %s: " % username) | |
realm = "test" | |
base_url = "http://test/" |
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
with import <nixpkgs> {}; | |
stdenv.mkDerivation { | |
name = "brainblast-1.0"; | |
src = fetchurl { | |
url = https://github.com/Zitrax/brainblast/archive/2068025f3a411000ee506f525188d586c327d226.tar.gz; | |
sha256 = "116pddal9n3bypnj3q6sggrzphzq1rfkqh5skyqfa1ha7mlspl19"; | |
}; |
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 <string> | |
#include <iostream> | |
#include <memory> | |
template<typename T, typename U=T> | |
U convert(T&& t) { | |
return std::forward<T>(t); | |
} | |
const char* convert(const std::string& s) { |
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
# OperaCritic | |
# | |
# VERSION 0.1.0 | |
# Note, a pre-release of 18.04 was tested but posgres did not want to start | |
# there. And in ubuntu 16.04 apache crashed (possibly due to old mod_wsgi, not | |
# tested with the pip version) | |
FROM ubuntu:17.10 | |
# Originally based on https://hub.docker.com/r/tjarosik/critic/ | |
MAINTAINER Daniel Bengtsson <daniel@bengtssons.info> |
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 | |
# System-wide crontab file and cron job directory. Change these for your system. | |
CRONTAB='/etc/crontab' | |
CRONDIR='/etc/cron.d' | |
# Single tab character. Annoyingly necessary. | |
tab=$(echo -en "\t") | |
# Given a stream of crontab lines, exclude non-cron job lines, replace |
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 <string> | |
#include <iostream> | |
#include <memory> | |
// Since it's not possible to partially specialize a function | |
// template we use overloads with a rank to try the overloads | |
// in a specific order. | |
// | |
// Using rank introduces "priority" because implicit conversions are required to | |
// convert a rank<X> to a rank<Y> when X > Y. dispatch first tries to call dummy |
OlderNewer