Skip to content

Instantly share code, notes, and snippets.

View jacqui's full-sized avatar

Jacqui Lough jacqui

View GitHub Profile
@malev
malev / README.md
Last active August 29, 2015 14:08
Convert CSV files into HTML

CSV to HTML (cli)

Just run:

$ ruby csvtohtml.rb data.csv > table.html

You can customize the table's id, table's classes, header's classes and field's classes. You can also use linux pipes and it's only one small file long with NO dependencies.

Pseudo installation (not needed)

@mbbx6spp
mbbx6spp / .vimrc
Created August 31, 2010 20:57
Start configuration for vim for new shell accounts. this starter config depends on the following Vim plugins: rails, pathogen, vimchat, sessionman, bufexplorer, fuzzy finder, NERDTree, gist. Primary development languages: Erlang, Haskell, Ruby, Zsh scrip
" Author: Susan Potter
" Using ~/.vim/supo as placeholder initialization VimScripts location.
" Didn't want to use ~/.vim/init in case init had or starts to have special meaning for Vim plugins or loading.
source $HOME/.vim/supo/global.vim
source $HOME/.vim/supo/functions.vim
if Rails.env.development?
around_filter :perform_profile
end
# In development mode, optionally perform a RubyProf profile of any request.
# Simply pass perform_profile=true in your params.
def perform_profile
return yield unless params[:perform_profile]
require 'ruby-prof'
RubyProf.start
require 'rubygems'
fetcher = Gem::SpecFetcher.fetcher
my_dep = 'activesupport'
# 1st arg = all (true to get all versions, false to get latest)
# 2nd arg = prerelase (true to get pre-release gems, false to get stable)
all_gems = fetcher.list(false, false)
# In development mode, optionally perform a RubyProf profile of any request.
# Simply pass perform_profile=true in your params.
def perform_profile
return yield unless params[:perform_profile]
require 'ruby-prof'
RubyProf.start
yield
result = RubyProf.stop
printer = RubyProf::FlatPrinter.new(result)
File.open("#{Rails.root}/tmp/profile.txt", 'w+') do |f|
@bleything
bleything / homedir.rake
Created January 2, 2013 00:32
Stick this in your homedir repo. Run rake. Watch in amazement as it symlinks everything.
require 'find'
BLACKLIST = %w[
.git
.gitignore
Rakefile
]
task :default do
Find.find('.') do |path|
@catwell
catwell / bench.lua
Created October 18, 2011 20:11
Redis Scripting speed
require "redis"
local WMAX = 100000
local rc = Redis.connect("unix:///tmp/redis.sock")
local rs_mhset = [[
local keys,argv,rcall = KEYS,ARGV,redis.call
local n,f = 0,argv[#keys+1]
for i,k in ipairs(keys) do n = n + rcall("hset",k,f,argv[i]) end
return n
@jacqui
jacqui / buenos-aires-recommendations.md
Last active July 27, 2017 15:56
places to eat, drink, stuff to do and see in the lovely port city of Buenos Aires

Buenos Aires

Restaurants & Food

  • Famous & fancy: Patagonia Sur
  • Pizzeria Guerrin excellent pizza, maybe the best in the city
  • Some cute cafes, all equally good, nice for breakfast or lunch: Malvon, Oui Oui
  • Historic cafe: Las Violetas
  • STEAK: some good places I've been are:
    • Social la Lechuza - ok, probably not the best steak in town, but for ambiance this place is neat, it's a social club with an owl (la lechuza) theme, walls are covered in customer drawings of, yes, owls. I like the joint.
@bryanl
bryanl / campfire-emoji.txt
Created January 27, 2011 16:34
campfire emoji
Surround these with : e.g. :calling:
+1
-1
bulb
calling
clap
cop
email
feet
# coding=UTF-8
from __future__ import division
import nltk
import re
import requests
# Add your freebase key here
# If you don't have one, register at https://code.google.com/apis/console
FREEBASE_KEY = ""