Skip to content

Instantly share code, notes, and snippets.

View itayadler's full-sized avatar

Itay Adler itayadler

View GitHub Profile
@itayadler
itayadler / imdb_db_downloader
Created October 17, 2013 21:08
A simple Ruby script I wrote to download the IMDB Plain Text DB. Simply save it as a file with executable permissions and it will hopefully work.
#!/usr/bin/env ruby --disable-gems
# vim: set ft=ruby:
require 'net/ftp'
require 'benchmark'
#Consts
IMDB_FTP_HOST = 'ftp.fu-berlin.de'
IMDB_FTP_DATA_PATH = '/pub/misc/movies/database'
README = <<-README
This is a simple Ruby script that downloads the entire IMDB Plain Text DB into a specified folder.
@itayadler
itayadler / gist:4297026
Created December 15, 2012 16:50
Spiral Printer
class NotSupportedArraySize < StandardError; end
class SpiralPrinter
def print(array)
finalResult = []
size = array.length
modulo = Math.sqrt(size).to_i
raise NotSupportedArraySize if modulo**2 != size
@itayadler
itayadler / gist:3579128
Created September 1, 2012 16:17
List of Gary Bernhardt talks
@itayadler
itayadler / rename_files_in_dir_to_lowercase.sh
Created December 26, 2011 12:30
This bash script can be used to rename all the files in the current directory
#!/bin/bash
for i in *.*; do mv "$f" "${f,,}"; done