Skip to content

Instantly share code, notes, and snippets.

@akloboucnik
akloboucnik / process_csv.rb
Created November 24, 2011 11:55
Proces large CSV file in ruby
require "csv"
result = File.new("result.csv", "w+")
CSV.foreach("./testfile.csv") do |line|
result << "#{line[2]};#{line[1]};#{line[0]}"
end
@akloboucnik
akloboucnik / Vagrantfile-rubystack
Created February 12, 2012 13:04
Vagrantfile for JP Consult's Ruby Stack 1.0
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "talifun-ubuntu-11.04-server-i386"
@akloboucnik
akloboucnik / Gemfile
Created March 18, 2012 18:43
Tugendhat free places scraper
# A sample Gemfile
source "https://rubygems.org"
gem "nokogiri"
@akloboucnik
akloboucnik / namespace.coffee
Created May 24, 2012 12:39
CoffeeScript namespace 101
namespace = (target, name, block) ->
[target, name, block] = [(if typeof exports isnt 'undefined' then exports else window), arguments...] if arguments.length < 3
top = target
target = target[item] or= {} for item in name.split '.'
block target, top
namespace '', (exports, root) -> root.namespace = namespace
@akloboucnik
akloboucnik / package.json
Created June 13, 2012 06:07
Issue API cruncher for JPC Redmine
{
"name": "redmine-issue-api-cruncher",
"version": "0.0.1",
"dependencies" : {
"underscore": "~> 1.3.3",
"restler": "~> 2.0",
"date-utils": "~> 1.2"
}
}
@akloboucnik
akloboucnik / gist:3003682
Created June 27, 2012 12:11
Blank Favicon
<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" rel="icon" type="image/x-icon" />
@akloboucnik
akloboucnik / fabfile.py
Last active January 2, 2016 02:28
JSBin deployment
from fabric.api import settings, run, cd
from fabric.state import env
from fabric.contrib.console import confirm
from fabric.context_managers import shell_env
from os import urandom
# yum install node sqlite-devel gcc-c++
def install_rpms():
# TODO check if installed first
run('yum -y install node sqlite-devel gcc-c++')
@akloboucnik
akloboucnik / notebook.ipynb
Last active January 2, 2016 09:09
Pandas 010
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@akloboucnik
akloboucnik / uploadToInstance.sh
Created February 12, 2015 14:50
Upload to instance
#!/bin/bash
# use to upload files in opt common to instance
# to usage with fswatch tool use like this:
# - copy to repository root
# - run: fswatch -0 . | xargs -0 -n1 -I {} ./uploadToInstance.sh {} akl-aa
#
# $1 - path to changed file
# $2 - instance hostname
# remove afplay part if not on mac

Keybase proof

I hereby claim:

  • I am akloboucnik on github.
  • I am klob (https://keybase.io/klob) on keybase.
  • I have a public key whose fingerprint is 3CBF 154D FF36 8777 BBB2 0BEA F83D 368E 0744 A024

To claim this, I am signing this object: