Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'csv'
abort("You must specify a CSV file") unless ARGV.length == 1
CSV do |out|
CSV.foreach(ARGV[0], encoding: 'ISO-8859-1') do |row|
out << row.map { |c| c.nil? ? nil : c.encode('UTF-8') }
end
http://facebook.com/
http://twitter.com/
http://google.com/
http://youtube.com/
http://wordpress.org/
http://adobe.com/
http://blogspot.com/
http://wikipedia.org/
http://linkedin.com/
http://wordpress.com/
@Lytol
Lytol / csgo.md
Last active December 28, 2015 15:28
Counter-Strike:GO Server

Game Modes

  • Classic Casual - game_type 0 game_mode 0
  • Classic Competitive - game_type 0 game_mode 1
  • Arms Race - game_type 1 game_mode 0
  • Demolition - game_type 1 game_mode 1
  • Deathmatch - game_type 1 game_mode 2

General

@Lytol
Lytol / IRSSI Cheat Sheet.md
Last active January 24, 2020 04:57
IRSSI Cheat Sheet

General

  • /quit – Quit IRSSI

Windows

  • option+# – Navigate to specified window
  • ctrl-n – Navigate to next window
  • ctrl-p – Navigate to previous window
@Lytol
Lytol / gist:5015688
Last active December 14, 2015 02:39
Beginner's Guide to Vim
require 'yaml'
module MyRailsApp
module Config
extend self
def [](key)
hash[key.to_sym]
end
@Lytol
Lytol / gist:1065962
Created July 5, 2011 21:14
Body tag helper that sets class and id based on controller/action
def body_tag(&blk)
controller_name = controller.class.to_s.underscore.gsub(/_controller$/, '').gsub(/\//,'_')
action_name = controller.action_name.underscore.gsub(/_/,'-')
content_tag(:body, :id => "#{controller_name}-#{action_name}", :class => controller_name, &blk)
end
@Lytol
Lytol / gist:1047900
Created June 26, 2011 19:34
GitConfig
[core]
editor = /usr/bin/vim
[alias]
st = status
br = branch
d = diff
ci = commit -v
cia = commit -v -a
co = checkout
cp = cherry-pick
begin
require 'autotest/growl'
Autotest::Growl::image_dir = File.join(ENV['HOME'], '.autotest-growl')
Autotest::Growl::hide_label = true
Autotest::Growl::clear_terminal = false
rescue LoadError
puts "No Growl support -- gem install autotest-growl"
end
TARGET=pomodoro
MCU=attiny13
CC=/usr/bin/avr-gcc
CFLAGS=-g -Os -Wall -mcall-prologues -mmcu=$(MCU)
OBJ2HEX=/usr/bin/avr-objcopy
AVRDUDE=/usr/bin/avrdude
program : $(TARGET).hex
sudo $(AVRDUDE) -c usbtiny -p$(MCU) -U flash:w:$(TARGET).hex