Skip to content

Instantly share code, notes, and snippets.

View floere's full-sized avatar
😁
Open Sourcing

Florian R. Hanke floere

😁
Open Sourcing
View GitHub Profile
@floere
floere / Config.gd
Last active September 25, 2024 20:02
Godot Config global for loading/storing user settings
extends Node
# This is the "global class" Config.
## Emitted once when the Config is loaded for the first time (after the game is loaded).
signal loaded
## Emitted when an audio volume was set.
signal audio_volume_set(bus_name: String, value_in_db: float)
## Emitted when the mouse cursor size was set.
signal visual_cursor_size_set(size: Vector2)
@floere
floere / Analytics cocoapods.org Top Not Found Events 20150903-20151003.tsv
Created October 3, 2015 20:54
Analytics cocoapods.org Top Not Found Events 20150903-20151003
Event Label Event Action Total Events Unique Events Event Value Avg. Value
gog not found 101 66 0 0.00
* not found 72 33 0 0.00
Alamofire-SwiftyJSON not found 65 27 0 0.00
lang:swift zip not found 60 40 0 0.00
lang:objc MantleXMLAdapter not found 55 1 0 0.00
coca not found 54 37 0 0.00
swiftjson not found 54 26 0 0.00
almofire not found 53 24 0 0.00
alamor not found 49 30 0 0.00

Keybase proof

I hereby claim:

  • I am floere on github.
  • I am hanke (https://keybase.io/hanke) on keybase.
  • I have a public key whose fingerprint is 275C 528B 9AF2 B800 1A03 B7A0 4FA6 A8F9 CF1C 1307

To claim this, I am signing this object:

@floere
floere / hashmemtest.sh
Last active August 29, 2015 13:56
Assigning nil values to 1'000'000 string keys: Memory usage comparison between MRI Ruby 1.9.3 and 2.1.0
chruby 1.9.3
ruby hashmemtest1.rb
ruby hashmemtest2.rb
ruby hashmemtest3.rb
chruby 2.1.0
ruby hashmemtest1.rb
ruby hashmemtest2.rb
ruby hashmemtest3.rb
@floere
floere / hashmemtest1.rb
Last active August 29, 2015 13:56
Quick hash memory test to understand high memory usage when using hashes in Ruby 1.9.3 and 2.1.0 (regarding newly created strings and old hashes).
# We repeatedly fill a hash.
# We use the same keyspace each time after the first time.
#
# My expectation was that the total memory used would not increase significantly after the first iteration.
#
h = {}
10.times do |i|
100000.times do |i|
h[i.to_s] = [1,2,3]
end
@floere
floere / objects_after_1_reindexing.txt
Created January 30, 2014 09:40
search.cocoapods.org Object Allocations
3534 /Users/hanke/temp/cocoapods/search.cocoapods.org/lib/pods.rb:55:OBJECT
3534 /Users/hanke/temp/cocoapods/search.cocoapods.org/lib/pods.rb:56:STRING
3534 /Users/hanke/temp/cocoapods/search.cocoapods.org/lib/pods.rb:57:HASH
3535 /Users/hanke/temp/cocoapods/search.cocoapods.org/lib/pods.rb:58:STRING
4358 /Users/hanke/.gem/ruby/2.1.0/gems/cocoapods-core-0.29.0/lib/cocoapods-core/specification.rb:280:OBJECT
4500 /Users/hanke/.gem/ruby/2.1.0/gems/cocoapods-core-0.29.0/lib/cocoapods-core/specification.rb:34:HASH
4500 /Users/hanke/.gem/ruby/2.1.0/gems/cocoapods-core-0.29.0/lib/cocoapods-core/specification.rb:35:ARRAY
4500 /Users/hanke/.gem/ruby/2.1.0/gems/cocoapods-core-0.29.0/lib/cocoapods-core/specification.rb:36:HASH
4500 /Users/hanke/.gem/ruby/2.1.0/gems/cocoapods-core-0.29.0/lib/cocoapods-core/specification.rb:38:STRING
5192 /Users/hanke/.gem/ruby/2.1.0/gems/cocoapods-core-0.29.0/lib/cocoapods-core/specification/dsl.rb:443:STRING
@floere
floere / gist:8704885
Created January 30, 2014 08:57
Heroku installing ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
/app/tmp/buildpacks/ruby/lib/language_pack/ruby.rb:760:in `block in purge_bundler_cache': undefined local variable or method `install_language_pack_gems' for #<LanguagePack::Rack:0x000000014692f8> (NameError)
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:17:in `block in instrument'
from /usr/local/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:16:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:43:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:39:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/ruby.rb:756:in `purge_bundler_cache'
from /app/tmp/buildpacks/ruby/lib/language_pack/ruby.rb:722:in `block in load_bundler_cache'
@floere
floere / perfer
Last active January 2, 2016 05:59
Comparison of 1000 queries each using Picky running on Ruby 1.9 and 2.1. (Not a good absolute measurement, as the case is pathological – but good for comparison between Rubies)
hanke@soyuz:performance:[master *] chruby 1.9
hanke@soyuz:performance:[master *] perfer run -m 5 perfer.rb
Sanity check:
>|2014-01-04 21:34:25|0.000096|florian | 1| 0| 1|
Session Search#search with ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.0]
Taking 5 measurements of at least 1.0s
Search#search('florian') with variable index size and fixed search size 1024 in 68.06 ms ± 6.077 ( 8.9%)
Search#search('florian') with variable index size and fixed search size 2048 in 82.98 ms ± 6.361 ( 7.7%)
@floere
floere / embedded_strings.rb
Last active December 21, 2015 13:49
String#split behaviour with embedded strings.
s = "One Two Three" # Shorter than 24 characters.
s.split /\s/ # Uncomment and comment. Why does the original string now occur 2 more times (1 per match?) in the ObjectSpace than without splitting?
times = 0
ObjectSpace.each_object(String) do |str|
times += 1 if str == s
end
p times
@floere
floere / prettyprint.sh
Created May 9, 2013 12:22
Printing with line numbers, color, and wrapping into a PDF.
~/bin $ cat prettyprint
#!/bin/sh
PDF_FILE=/tmp/temp.pdf
PS_FILE=/tmp/temp.ps
vim \
"+set number" "+syntax on" "+color slate" \
"+set printoptions=number:y" \
"+set printfont=courier:h9" \