Skip to content

Instantly share code, notes, and snippets.

View hakanai's full-sized avatar
⚔️
Battling i16n demons

Hakanai hakanai

⚔️
Battling i16n demons
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hakanai
hakanai / hmm.rb
Last active October 27, 2017 05:33
An esoteric Ruby problem
# Currently writing:
let(:worker_script) do
<<-EOS
def nuix_worker_item_callback(worker_item)
source_item = worker_item.source_item
if source_item.parent.name =~ /Test Email/
worker_item.process_embedded = "#{process_embedded}"
end
end
diff --git a/server/build.gradle b/server/build.gradle
index fc73fa57dee..4e21a481c5c 100644
--- a/server/build.gradle
+++ b/server/build.gradle
@@ -18,6 +18,7 @@ dependencies {
compile libraries.derbynet
compile libraries.gson
compile libraries.guava
+ compile libraries.httpclient^M
compile libraries.icu4j
@hakanai
hakanai / Welp.md
Last active September 8, 2017 04:08

This is a list of questionable or ambiguous clauses in the ANZ custom credit card image guidelines which prevent me making a Hatsune Miku credit card, even though there should be no issue with it due to the relatively open character licence.

Source

  • No trademarks, logos, slogans, company names, get up, copyrighted material or brands of any third party

You could avoid using the logo, but the character design itself is of course copyrighted.

@hakanai
hakanai / lyrics.txt
Last active September 14, 2017 12:49
The best song of 2017
Nice to meet you
Music and lyrics: LamazeP
Published at: http://www.nicovideo.jp/watch/sm31840291
「初めまして」でいいかな?          | - | May I start with, 'Nice to meet you'?
私は電子の歌姫なのです            | | I am an electronic diva
よろしくね                  | | I hope we get along
                       | |
投げ出しそうになる君へ            | | To the you who is about to give up
@hakanai
hakanai / kill_rspec.spec
Created August 2, 2017 04:15
Quality stuff
describe 'RSpec' do
it 'never returns from this spec' do
actual_path_names = ["y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y2", "y3", "y4", "y5", "y5", "y5", "y6", "y6", "y6", "y7", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y8", "y9", "y9", "y9", "y9", "y9", "y9", "y9", "y9", "y9", "y9", "y9", "y9", "y9", "y9", "y9", "y10", "y10", "y10", "y11", "y11", "y11", "y11", "y12", "y12", "y12", "y13", "y13", "y13", "y14"]
puts "actual_path_names.size = #{actual_path_names.size}"
expected_path_names = ["y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y1", "y2", "y3", "y3", "y3", "y3", "y3", "y3", "y3", "y3", "y3", "y3", "y3", "y
@hakanai
hakanai / gist:ca8e3b293629a4a1eeb3db78847a68f1
Created July 27, 2017 01:12
What Elasticsearch has open right now
java 79719 tester cwd DIR 1,1 476 406079161 /Data/Projects/acme/trunk/product/functional-tests/build/elasticsearch
java 79719 tester txt REG 1,1 103632 315865616 /Users/tester/DevEnv/Java/jdk1.8.0_92.jdk/Contents/Home/bin/java
java 79719 tester txt REG 1,1 49472 315865853 /Users/tester/DevEnv/Java/jdk1.8.0_92.jdk/Contents/Home/jre/lib/libverify.dylib
java 79719 tester txt REG 1,1 216812 315865817 /Users/tester/DevEnv/Java/jdk1.8.0_92.jdk/Contents/Home/jre/lib/libjava.dylib
java 79719 tester txt REG 1,1 32768 408051858 /private/var/folders/d5/p7yfxkhx4673nd7z7lz_t36c0000gn/T/hsperfdata_tester/79719
java 79719 tester txt REG 1,1 36680 315865854 /Users/tester/DevEnv/Java/jdk1.8.0_92.jdk/Contents/Home/jre/lib/libzip.dylib
java 79719 tester txt REG 1,1 18128 406079241 /Data/Projects/acme/trunk/
@hakanai
hakanai / keys.txt
Last active June 2, 2017 07:30
Mac international key bindings
ROW 1
=====
` U+0060 GRAVE ACCENT
shift: ~ U+007E TILDE
alt: ` U+0300 COMBINING GRAVE ACCENT
1 U+0031 DIGIT ONE
shift: ! U+0021 EXCLAMATION MARK
@hakanai
hakanai / Investigation.md
Last active May 14, 2017 11:36
Android Wear 2.0 - SimpleDateFormat no longer usable

I had posted a question to Stack Overflow.

If Android didn't restrict unit tests by stubbing out the entire API to return null, I would be able to reproduce this in unit tests, but alas, the unit tests pass. This also means unit tests are useless when developing for the Android platform. This in turn might explain why the quality of most applications on the platform is so "High Kwality".

Since unit tests are unusable, I'm currently at the point where I have resorted to debugging the running Android process.

$ iex
Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Interactive Elixir (1.4.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> String.slice("cafe\u0301", 0..3)
"café"
iex(2)> String.slice("cafe\u0301", 0..2)
"caf"