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
@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 / 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 / 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
module Main where
import Test
import Data.Typeable
main :: IO ()
main = do
putStrLn $ show $ double 2
putStrLn $ show $ quadruple 2
putStrLn $ show $ factorial 10
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
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
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
@SamuelMarks
SamuelMarks / pyman
Last active January 2, 2016 04:09 — forked from ekimekim/pyman
#!/usr/bin/env python
from sys import argv, exit
if __name__ == '__main__':
if len(argv) < 2:
print "USAGE: {0} MODULE [SYMBOL]".format(argv[0])
print "Open help() for given module, or given symbol from module"
exit(1)
@SamuelMarks
SamuelMarks / egghead_YouTube_downloader.py
Last active November 3, 2018 09:32
Simple algorithm to download all the egghead.io videos in highest-quality from YouTube.
"""
Simple algorithm to download all the egghead.io videos in highest-quality from YouTube.
Run from the directory you want the videos to appear. Renames them so that they have the video number + omit the repetitive "Egghead.io - AngularJS -" text.
Installing dependency:
$ pip install git+https://github.com/NFicano/pytube#egg=pytube
"""
from pytube import YouTube #, exceptions as YTD_exceptions
\documentclass[a4paper,11pt]{article}
\usepackage[english]{babel}
\usepackage{amsmath,amssymb,cancel,array,graphics,enumerate,fancyhdr,graphviz,psfrag,minted}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\title{}
\author{Samuel Marks}
\begin{document}