Skip to content

Instantly share code, notes, and snippets.

View SamuelMarks's full-sized avatar
:octocat:
C > Rust > Go > TypeScript > C++

Samuel Marks SamuelMarks

:octocat:
C > Rust > Go > TypeScript > C++
View GitHub Profile
from json import dumps, loads
from uuid import uuid4
from collections import OrderedDict
from klein import Klein
from exceptions import BaseException
class UniqueKeyError(BaseException):
pass
from os import environ
from json import dumps, loads
from uuid import uuid4
from collections import OrderedDict
from klein import Klein
from exceptions import Exception
from pprint import PrettyPrinter
Warning 1 warning MSB8028: The intermediate directory (Release\) contains files shared from another project (libprotobuf-lite.vcxproj, libprotoc.vcxproj, lite-test.vcxproj, protoc.vcxproj, tests.vcxproj, test_plugin.vcxproj). This can lead to incorrect clean and rebuild behavior. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets 381 5 libprotobuf
Error 2 error C2146: syntax error : missing ';' before identifier 'ThreadCache' E:\Projects\protobuf\src\google\protobuf\arena.h 315 1 libprotobuf
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int E:\Projects\protobuf\src\google\protobuf\arena.h 315 1 libprotobuf
Error 4 error C2146: syntax error : missing ';' before identifier 'ThreadCache' E:\Projects\protobuf\src\google\protobuf\arena.h 315 1 libprotobuf
Error 5 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int E:\Projects\protobuf\src\google\protobuf\arena.h 315 1 libprotobuf
Error 6 error C214
module Main where
import Test
import Data.Typeable
main :: IO ()
main = do
putStrLn $ show $ double 2
putStrLn $ show $ quadruple 2
putStrLn $ show $ factorial 10
@SamuelMarks
SamuelMarks / output
Created February 17, 2015 13:32
pip freeze
beautifulsoup4==4.3.2
bettertutors-rest-api==0.2.5
bettertutors-user-api==0.2.8
bottle==0.12.8
gunicorn==19.2.1
six==1.9.0
waitress==0.8.9
WebOb==1.4
WebTest==2.0.18
@SamuelMarks
SamuelMarks / setup.py
Last active August 29, 2015 14:15
An attempt to explicitly installs package dependencies **before** running `setuptools.setup`…
from pip.commands import install
from pip.exceptions import DistributionNotFound
def setup2(**kwargs):
kwargs['install_requires'] = kwargs.get('dependency_links', []) + kwargs.get('install_requires', [])
if path.exists('requirements.txt'):
kwargs['install_requires'] += open('requirements.txt', 'r').readlines()
@SamuelMarks
SamuelMarks / gen_png_from_dot.bash
Created March 9, 2015 22:57
gen_png_from_dot.bash
#!/usr/bin/env bash
if [ -z "$1" ]; then
>&2 echo "Usage: gen_png_from_dot <dot_file> <png_location=exports>"
exit 1
fi
while inotifywait -e close_write "$1";
do `which dot` -Tpng -o "${2:-exports}/${1%???}.png" "$1";
done
@SamuelMarks
SamuelMarks / CMakeLists.txt
Created November 17, 2015 11:19
phc-winner-argon2 CMake
cmake_minimum_required(VERSION 3.3)
project(phc_winner_argon2)
set(SOURCE_FILES
src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c)
set(SRC_RUN src/run.c)
set(SRC_BENCH src/bench.c)
set(SRC_GENKAT src/genkat.c)
set(RUN argon2)
#!/usr/bin/env python
import json
from sys import argv
from os import path
with open(argv[1]) as f:
s = f.readlines()
session = json.loads(s[4])
{{if response.flash:}}
<header style="padding-top: 35px">
{{if 'errors' in response.flash:}}
<div class="alert alert-block alert-error fade in">
<button type="button" class="close" data-dismiss="alert">
&times;
</button>
<p>
{{=response.flash}}
</p>