Skip to content

Instantly share code, notes, and snippets.

☕️
<peon>work work</peon>

Guido Gloor Modjib haslo

☕️
<peon>work work</peon>
Block or report user

Report or block haslo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@haslo
haslo / json_export.rb
Last active Oct 26, 2016
Exports a nested JSON into an Excel, to send to clients for translations
View json_export.rb
#!/usr/bin/env ruby
require 'json'
require 'spreadsheet'
def process_hash(translations, current_key, hash)
hash.each do |new_key, value|
combined_key = [current_key, new_key].delete_if { |k| k == '' }.join(".")
if value.is_a?(Hash)
process_hash(translations, combined_key, value)
@haslo
haslo / unity_proxy.md
Last active Mar 22, 2017
Proxy for Tabletop Simulator's Unity HTTPS problems
View unity_proxy.md
View .gitconfig
[alias]
cheat = !git add -A && git commit --amend -C HEAD && git push -f
branchdates = !git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate) %(authorname) %(refname:short)'
deletemerged = !git branch --merged | grep -v '^* master$' | grep -v '^ master$' | xargs git branch -d
cleanup = !git checkout master && git pull && git deletemerged && git branch
[log]
decorate = full
[color]
ui = true
@haslo
haslo / gist:43a8abd5cff600094cef
Created Jul 10, 2015
CSV-Export DB from Ruby / PostgreSQL
View gist:43a8abd5cff600094cef
# inspired by: https://github.com/oxon/logistaegvm/blob/master/lib/tasks/export.rake
# required gems:
# * pg
# * rubyzip
unless ARGV.count == 1
puts 'Required argument: Output directory'
exit 1
end
@haslo
haslo / yml_export.rb
Last active Oct 26, 2016
Export locale files from YAML to CSV, for further processing by clients
View yml_export.rb
#!/usr/bin/env ruby
require 'yaml'
require 'deep_merge'
require 'find'
require 'spreadsheet'
def process_hash(translations, current_key, hash)
hash.each do |new_key, value|
combined_key = [current_key, new_key].delete_if { |k| k == '' }.join(".")
@haslo
haslo / model_with_json_data.rb
Last active Aug 29, 2015
Getters and Setters for JSON Data Fields for ActiveRecord Models
View model_with_json_data.rb
module Concerns
module ModelWithJSONData
extend ActiveSupport::Concern
module ClassMethods
def json_data_field_descriptions
[]
end
end
@haslo
haslo / yosemite.md
Last active Aug 29, 2015
Yosemite Stuff
View yosemite.md
You can’t perform that action at this time.