View gist:d2c0bca7380f33288cdb
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
TASK: [common | upgrade system packages] ************************************** | |
failed: [celery_stats_testing] => {"failed": true, "item": ""} | |
stdout: Reading package lists... | |
Building dependency tree... | |
Reading state information... | |
Initializing package states... | |
Writing extended state information... | |
Resolving dependencies... | |
The following NEW packages will be installed: | |
liblcms2-2{a} linux-headers-3.2.0-64{a} linux-headers-3.2.0-64-virtual{a} |
View gist:79c7d21833fd33243d6f
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 open('./search/data/seo_service_landing_service_data.yml') as f: | |
service_data = yaml.safe_load(f) | |
for x in service_data: | |
service_data[x]['see_also'] = [TOP_TEN[i] for i in (random.sample(xrange(len(TOP_TEN)), 4))] | |
with open('./search/data/seo_service_landing_service_data.yml', 'w') as f: | |
pyaml.dump(service_data, f) |
View gist:c1cb3024040025a5b706
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
$(document).ready(function() { | |
var closeMenu = function() { | |
$('#container').unbind('touchmove'); | |
$("#container").animate({"margin-left": "0"}, { | |
duration: 700, | |
complete: function() { | |
$('#content').css('width', 'auto'); | |
$('#contentLayer').css('display', 'none'); |
View balancedParens.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
def balancedParens(s): | |
stack, opens, closes = [], ['(', '[', '{'], [')', ']', '}'] | |
for c in s: | |
if c in opens: | |
stack.append(c) | |
elif c in closes: | |
try: | |
if opens.index(stack.pop()) != closes.index(c): | |
return False | |
except (ValueError, IndexError): |
View youtube.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
############################# | |
# | |
# Needed it to download this guy: https://www.youtube.com/playlist?list=PLPemlF-zX2ydW5QoNsHpQiLCQKIKdjvoo | |
# | |
# Figured why not stick it up on github too. | |
# | |
############################# | |
import pafy | |
import os |
View gist:71b3ac3d851b59de3ddb
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
### Keybase proof | |
I hereby claim: | |
* I am adammenges on github. | |
* I am adammenges (https://keybase.io/adammenges) on keybase. | |
* I have a public key whose fingerprint is 4C50 C670 FDCD 994E EC08 D308 C8A2 1C16 63B6 3476 | |
To claim this, I am signing this object: |
View ml-bot.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
############################################################################## | |
## ## | |
## ## | |
## ( \/ )( ) ___( _ \ / \(_ _) ## | |
## / \/ \/ (_/\(___)) _ (( O ) )( ## | |
## \_)(_/\____/ (____/ \__/ (__) ## | |
## ## | |
## ## | |
## ## | |
## The beginings of an ml-bot. To start, he'll let us know when ## |
View hackernewscorpus.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
# coding: utf-8 | |
import requests | |
import os.path | |
import time | |
def multiple_tries(func, times, timeout): | |
for cnt in xrange(1, times + 1): | |
try: | |
return func() | |
except Exception, e: |
View sklearn.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 string, sklearn, random | |
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer | |
from sklearn.svm import SVC | |
from sklearn.pipeline import Pipeline | |
from sklearn.grid_search import GridSearchCV | |
from sklearn.cross_validation import StratifiedKFold | |
def tok(m): | |
return m.split() |
View min-char-rnn.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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |