Skip to content

Instantly share code, notes, and snippets.

View sirkosi's full-sized avatar
🎯
Focusing

Sirko sirkosi

🎯
Focusing
View GitHub Profile
require 'csv'
require 'json'
csv_string = CSV.generate do |csv|
JSON.parse(File.open("foo.json").read).each do |hash|
csv << hash.values
end
end
puts csv_string
@sirkosi
sirkosi / reverse_index.rb
Created March 13, 2015 17:03
reverse each with original index.. don't ask..
class Array
def reverse_each_with_original_index
size_of_array = self.size
self.reverse.each_with_index do |object, i|
yield object, size_of_array - (i+1)
end
end
end
[:a, :b, :c].reverse_each_with_original_index{|object, index| puts "object: #{object} index: #{index}" }
@sirkosi
sirkosi / Teerb.itermcolors
Created October 17, 2012 13:58 — forked from teerb/Teerb.itermcolors
Iterm2 colorscheme based on Pnevma and Xoria256
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.1098039299249649</real>
<key>Green Component</key>
<real>0.1098039299249649</real>
@sirkosi
sirkosi / blink.py
Created October 23, 2012 22:07
raspberry pi example
@sirkosi
sirkosi / Preferences.sublime-settings
Last active October 29, 2015 14:57
Sublime Settings
{
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme",
"enable_tab_scrolling": false,
"ensure_newline_at_eof_on_save": true,
"font_size": 13,
"ignored_packages":
[
"Trimmer",
"Vintage"
],
# ubuntu
# copy to clipboard
xsel --clipboard < file.txt
# write from clipboard
xsel --clipboard < file.txt
@sirkosi
sirkosi / vlc_problems.md
Created November 7, 2015 18:19
VLC Problems

VLC Problems

VLC Codec Error

No suitable decoder module:
VLC does not support the audio or video format "hev1". Unfortunately there is no way for you to fix this.

VLC Debugging

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@sirkosi
sirkosi / prepare.sh
Last active December 22, 2015 18:34
preparations
# JAVA
sudo yum install java-1.7.0-openjdk-devel
# ElasticSearch
# http://www.itzgeek.com/how-tos/linux/centos-how-tos/how-to-install-elasticsearch-logstash-and-kibana-4-on-centos-7-rhel-7.html
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.0.noarch.rpm
sudo rpm -Uvh elasticsearch-1.5.0.noarch.rpm
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
git branch Autocomplete for mac
http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/