Skip to content

Instantly share code, notes, and snippets.

View nemo's full-sized avatar

Nima Gardideh nemo

View GitHub Profile
@nemo
nemo / tc_scrape.js
Last active March 13, 2017 22:21
Techcrunch Article Title Scraper
const lib = require('lib');
const async = require('async');
const _ = require('lodash');
var pages = [
'https://techcrunch.com/',
...(_.range(2, 100).map((i) => "https://techcrunch.com/page/" + i))
];
async.mapLimit(pages, 10, (pageUrl, callback) => {
@nemo
nemo / mem_err.py
Last active November 22, 2016 02:56
Keras memory error issue
from keras.models import Sequential
from keras.layers.core import Flatten, Dense, Dropout, Lambda
from keras.layers.normalization import BatchNormalization
from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.optimizers import SGD, RMSprop, Adam
from theano.sandbox import cuda
from keras.preprocessing import image
cuda.use('gpu')
@nemo
nemo / rollbar_error.md
Created April 22, 2015 07:22
Rollbar Crash
break in src/managers/LogManager.js:53
  51 
  52 
  53     debugger;
  54     rollbar.handleError(err, res);
  55     if (res) {
debug> repl
Press Ctrl + C to leave debug repl
> err
@nemo
nemo / reddit_thebutton.js
Created April 13, 2015 07:26
Get 1s on The Button in Reddit
// Go to http://www.reddit.com/r/thebutton
// 1. Click on the button once to unlock it.
// 2. Paste the following code into the Javascript Console in Chrome.
function getTheButton() {
var didPress = false;
var currentNumber = parseInt($("#thebutton-s-10s").text() + $("#thebutton-s-1s").text());
if (currentNumber === 1) { // 1 second left! Click!
$(".thebutton-container.active.unlocked").click();
@nemo
nemo / gist:4371269
Last active December 10, 2015 02:58
Check which BaseRecipes don't have an image
require 'ruby-progressbar'
base_recipes = BaseRecipe.where(:draft => false)
pbar = ProgressBar.create :total => base_recipes.count
url_but_not_image = []
no_image_and_no_url = []
def image_exists(url)