Skip to content

Instantly share code, notes, and snippets.

View kumamotone's full-sized avatar
🐈
hello

kumamotone kumamotone

🐈
hello
View GitHub Profile
import UIKit
protocol SwipeReturnable {
func addSwipeReturnGesture()
}
extension SwipeReturnable where Self: UIViewController {
func addSwipeReturnGesture() {
let gestureToRight = UISwipeGestureRecognizer(target: self, action: #selector(self.swipeBack))
gestureToRight.direction = .Right
<?xml version="1.0"?>
<packages>
<package id="GoogleChrome" />
<package id="Firefox" />
<package id="Opera" />
<package id="googlejapaneseinput" />
<package id="flashplayerplugin" />
<package id="foobar2000" />
<package id="everything" />
<package id="listary" />
enum Hoge {
case normal
case `nil`
case `self`
case `dynamicType`
case `Type`
case `Protocol`
}
print(Hoge.normal) // normal
kumamoto@kumamotontu:~/iGAN$ THEANO_FLAGS='device=cpu, floatX=float32, nvcc.fastmath=True, optimizer_excluding=cudnn' python iGAN_main.py --model_name outdoor_64
[n_iters] = 40
[top_k] = 16
[average] = False
[morph_steps] = 16
[model_file] = ./models/outdoor_64.dcgan_theano
[d_weight] = 0.0
[interp] = linear
[batch_size] = 64
[framework] = theano
@kumamotone
kumamotone / config.fish
Created December 30, 2017 10:08
$HOME/.config/fish/config.fish
# peco
function fish_user_key_bindings
bind \cr peco_select_history
end
# set -x EDITOR 'atom'
# Mac は LS_COLORS, Ubuntu等は LSCOLORS
export LS_COLORS='di=36:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30'
export LSCOLORS=gxfxcxdxbxegedabagacad
@kumamotone
kumamotone / WeatherStationActivity.java
Created February 18, 2018 02:50
WeatherStationActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(TAG, "Weather Station Started");
try {
mDisplay = RainbowHat.openDisplay();
mDisplay.setEnabled(true);
mDisplay.display("OK ");
@kumamotone
kumamotone / WeatherStationActivity.kt
Last active February 18, 2018 02:56
WeatherStationActivity.kt
class WeatherStationActivity : Activity() {
private var mDisplay: AlphanumericDisplay? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Log.d(TAG, "Weather Station Started")
try {
mDisplay = RainbowHat.openDisplay()
mDisplay?.setEnabled(true)
@kumamotone
kumamotone / index.js
Created February 18, 2018 03:36
rmminiで家電を操作
var firebase = require("firebase");
var config = {
apiKey: "秘密",
authDomain: "秘密.firebaseapp.com",
databaseURL: "https://秘密.firebaseio.com",
projectId: "秘密",
storageBucket: "",
messagingSenderId: "秘密"
};
firebase.initializeApp(config);
@kumamotone
kumamotone / rmlist.js
Created February 18, 2018 03:46
RM Bridgeでキャプチャした信号  シーリングライトはパナソニック HH-CB0870A https://www.amazon.co.jp/dp/B01G568LVC/ エアコンは 白くまくん RAS-R22B
module.exports = {"light_on":
"2600ac00723a0d0f0d100d2c0d2c0d100c2d0c100d100c100d2c0d100c100d2c0d100c2d0c100d2c0d100c100d2c0d100c100d100c110c2d0c100d2c0d2c0d100c2d0c100d100c110c100c2d0c100d100c2d0c110c100c0009a1703a0d100c110c2c0d2d0c100c2d0c100d110b100d2c0d100c100d2c0d110b2d0d100c2d0c100d110b2d0c100d110b100d110b2d0c110c2c0d2c0d110b2d0c110c110b110c110b2d0c110c110c2c0d100c100d000d05000000000000000000000000",
"light_off":"2600ac00723a0d0f0d100d2c0d2c0d0f0d2c0d100d0f0d100d2c0d100c100d2c0d100c2d0c100d2c0d100c100d2c0d100d0f0d100c100d2c0d2c0d2c0d2c0d100d2c0d0f0d100d0f0d2d0c2d0c100d100c2d0c100d100c00099e733a0d100c100d2c0d2c0d100c2d0c100d100c100d2c0d100c110c2c0d100c2d0d0f0d2c0d100d100c2c0d110c100c100d100c2d0c2d0c2d0c2d0c100d2c0d100c100d100c2d0d2c0d100c100d2c0d0f0d100d000d05000000000000000000000000",
"aircon_off":"26005c030003eb00068c6c380d2b0c0f0c100c0f0d0f0c0f0d0f0c0f0d0f0c100c0f0c100c2b0c0f0d0f0c0f0d0f0c100c0f0c100c0f0d0f0c0f0d0f0c100c0f0c100c0f0d0f0c0f0d2a0d0f0c2b0c2b0d2a0d2a0d2b0c2b0c0f0d2a0d2a0d2b0c2b0c2b0c
@kumamotone
kumamotone / IntToBool.swift
Created March 21, 2018 17:56
A Codable struct converting a Int value to Bool.
public struct IntToBool: Codable {
public var value: Bool
public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
let intValue = try container.decode(Int.self)
self.value = (intValue != 0)
}
public init(value: Bool) {