Skip to content

Instantly share code, notes, and snippets.

View zigen's full-sized avatar
🏠
Working from home

Kentaro "zigen" Teramoto zigen

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am zigen on github.
  • I am zigen (https://keybase.io/zigen) on keybase.
  • I have a public key ASBIfT0-iHH059k1q6RjK9qX0XKE-g_snyTbAVHoGsMOzQo

To claim this, I am signing this object:

@zigen
zigen / react-native-maps+0.20.1.patch
Last active March 21, 2018 23:25
how to solve module become undefined bug in react-native@0.54.0 and react-native-maps@0.20.1
patch-package
--- a/node_modules/react-native-maps/index.js
+++ b/node_modules/react-native-maps/index.js
@@ -1,4 +1,4 @@
-import MapView from './lib/components/MapView';
+import MapView from './lib/components/MapView';
export { default as Marker } from './lib/components/MapMarker.js';
export { default as Polyline } from './lib/components/MapPolyline.js';
@@ -9,7 +9,9 @@ export { default as LocalTile } from './lib/components/MapLocalTile.js';
@zigen
zigen / nq.rb
Created September 16, 2015 14:21
#!/Users/hrl7/.rbenv/shims/ruby
def solve
puts "Solver Start"
board = [
[1, 0, 0, 0, 0, 0, 0, 0],
[1, 0, 0, 0, 0, 0, 0, 0],
[1, 0, 0, 0, 0, 0, 0, 0],
[1, 0, 0, 0, 0, 0, 0, 0],
[1, 0, 0, 0, 0, 0, 0, 0],
i=0
result = []
while nil != buf = gets
arr = []
arr = buf.split(" ").collect do |s| s.to_i end
result.push arr
end
print result
@zigen
zigen / group.rb
Created September 16, 2015 09:26
class Array
def group p
arr = self
res = []
start = 0
last = 0
while start + p <= arr.length
last = start + p -1
res.push(arr[start..last])
start = last + 1
buf = []
i=0
while nil != buf[i] = gets
buf[i] = buf[i].to_i
i += 1
end
@zigen
zigen / encr.rb
Created September 15, 2015 11:23
def encrypt str, key
for i in 0..str.length-1
print (str[i].ord + key), " "
end
end
for i in 0..25
encrypt "Hello",i
print "\n"
end
for i in 0.."Hello".length-1
print ("Hello"[i].ord + 1).chr
end
@zigen
zigen / gist:a17c0ed953a8b2e9945b
Created June 29, 2015 09:35
arduino調光器GUI
import controlP5.*;
import processing.serial.*;
ControlP5 cp5;
Knob[] colorKnob = new Knob[3];
Serial arduino;
color ledColor;
int r=0, g=0, b=0;
void setup()
{