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
@hakanai
hakanai / MakeStencilScannerGrid.java
Last active February 3, 2018 05:03
Generates a hex grid image
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
public class MakeStencilScannerGrid {
@hakanai
hakanai / OU3DScreen.shader
Last active May 3, 2019 08:31
Shaders to render 3D images and video (example of unity_StereoEyeIndex)
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "3D/OU3DScreen"
{
Properties
{
[HideInInspector] __dirty( "", Int ) = 1
_MainTex("MainTex", 2D) = "white" {}
[Toggle]_ToggleSwitch2("Toggle Switch2", Float) = 0
}
@hakanai
hakanai / make_cube.rb
Last active January 31, 2018 05:33
Quick and dirty .obj/.mtl generation in Ruby
#!/usr/bin/env ruby
require_relative 'obj'
obj = Obj.build('cube') do
# More about material properties here:
# https://en.wikipedia.org/wiki/Wavefront_.obj_file
# http://www.fileformat.info/format/material/
material = material('cube',
@hakanai
hakanai / HairAccessory.scad
Created January 30, 2018 02:19
Basic example of how to model Miku's hair accessories in OpenSCAD
color([0,0,0,1]) {
difference() {
cube([10,10,1], true);
cube([8,8,1.1], true);
for (i = [0:90:270]) {
rotate([0,0,i]) {
translate([4.8,0,0]) {
cube([0.6,11,1/3], true);
}
Shader "Pixelate" {
Properties {
_CellSize ("Cell Size", Vector) = (0.02, 0.02, 0, 0)
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
GrabPass { "_PixelationGrabTexture"}
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