Skip to content

Instantly share code, notes, and snippets.

@erogol
erogol / bing_scrap.py
Created May 29, 2014 10:07
bing scrabber but add more to query address
#!/bin/bash
from bs4 import BeautifulSoup
import requests
import urllib2
import os
import re, urlparse
import time
import pdb
from interruptingcow import timeout
@erogol
erogol / twitter_scrapper.py
Created December 25, 2013 22:34
scrap twitter wall given the search page address or simulating a browser via mechanize
'''
Written by:
Eren Golge - erengolge@gmail.com
'''
import json
import pdb
import urllib2
import mechanize
import cookielib
@erogol
erogol / maxout_layer
Created January 19, 2015 14:03
maxout layer implementation for caffe library
layers {
name: "conv1A"
type: CONVOLUTION
bottom: "data"
top: "conv1A"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
@erogol
erogol / crawle_google.py
Created September 22, 2013 10:57
scrap google images given the target query
#!/usr/bin/env python
'''
Query on GoogleImageSearch and install resulted images by scraping.
To use this script install mechanize and BeautifulSoup packages as
easy_install mechanize
easy_install Beautiful
@erogol
erogol / ddc_sentece_test_330k.ipynb
Last active May 14, 2021 09:40
DDC_sentece_test_330K.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
from scipy import linalg
from sklearn.utils import array2d, as_float_array
from sklearn.base import TransformerMixin, BaseEstimator
class ZCA(BaseEstimator, TransformerMixin):
def __init__(self, regularization=10**-5, copy=False):
self.regularization = regularization
@turicas
turicas / attrdict.py
Created December 22, 2011 16:21
Python class with dict-like get/set item
#!/usr/bin/env python
# coding: utf-8
class AttrDict(object):
def __init__(self, init=None):
if init is not None:
self.__dict__.update(init)
def __getitem__(self, key):
return self.__dict__[key]
@erogol
erogol / tts_example.ipynb
Last active February 12, 2024 23:46
TTS_example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hitvoice
hitvoice / plot_confusion_matrix.png
Last active February 21, 2024 19:51
Generate matrix plot for confusion matrix with pretty annotations.
plot_confusion_matrix.png

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: