View Dockerfile
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> |
View stringformat_constexpr_if.cpp
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> | |
/** | |
* Convert all std::strings to const char* using constexpr if (C++17) | |
*/ | |
template<typename T> | |
auto convert(T&& t) { |
View stringformat_const.cpp
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 |
View stringformat.cpp
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) { |
View brainblast.nix
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"; | |
}; |
View gist:fe01e7422817f4ba377348bac56afd10
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\"' - |
View gist:90f726a24785844a052d9cd5a4e44c11
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 |
View ubuntu-deps.py
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 argparse | |
import hashlib | |
import os | |
from collections import defaultdict | |
import sys | |
from bs4 import BeautifulSoup as bs | |
import re | |
import requests |
View mysql_speedtest.py
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()) |
View gist:4730967
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/" |
NewerOlder