Skip to content

Instantly share code, notes, and snippets.

@uzimith
uzimith / ignore-slack-user.js
Created September 15, 2017 09:26
ignore-slack-user.js
// ==UserScript==
// @name Ignore slack user
// @namespace https://github.com/uzimith/
// @version 0.1
// @description ignore slack user
// @author uzimith
// @match https://*.slack.com/*
// @grant none
// ==/UserScript==
@uzimith
uzimith / ignore-slack-user.js
Created September 15, 2017 09:26
ignore-slack-user.js
// ==UserScript==
// @name Ignore slack user
// @namespace https://github.com/uzimith/
// @version 0.1
// @description ignore slack user
// @author uzimith
// @match https://*.slack.com/*
// @grant none
// ==/UserScript==
fn main() {
let mut vec = vec!("1", "1");
let first = vec.pop();
let second = vec.pop();
match (first, second) {
(Some(a), Some(b)) if a == b => print!("yes"),
(Some(_), Some(_)) => print!("hi"),
_ => print!("no")
}
}
// JWKから公開鍵を作る
type JWK struct {
Keys []struct {
Kty string `json:"kty"`
Alg string `json:"alg"`
Use string `json:"use"`
Kid string `json:"kid"`
N string `json:"n"`
E string `json:"e"`
@uzimith
uzimith / connect_table_with_foreign_keys.py
Last active March 5, 2017 14:52
connect table with foreign keys (singularize(table)_id)
# -*- coding: utf-8 -*-
# MySQL Workbench Python script
# connect tables with foreign keys
# table: plural (sites)
# foreign_key: singularize(table)_id (site_id)
# Written in MySQL Workbench 6.3.9
import grt
import mforms
from wb import *
@uzimith
uzimith / cvim
Last active February 7, 2017 08:50
cvim
set noautofocus
let scrollstep=230
set smoothscroll
let scrollduration= 200
let barposition = "bottom"
let locale = "jp"
let hintcharacters = "hjklasdfgyuiopqertnmzxcvb"
let mapleader = ","
let blacklists = ["https://mail.google.com/*","*://mail.google.com/*","@https://mail.google.com/mail/*"]
let completionengines = ['google']
@uzimith
uzimith / app.js
Last active August 29, 2015 14:21
OWB <-> gluin <-> Arduino
//----------------------------------------
// Arduino
//----------------------------------------
// adb shell netstat起動を確認
var socket = navigator.mozTCPSocket.open('127.0.0.1', 9943);
socket.onopen = function () {
var param = {
// adb shell dmesgでArduinoのdevicenameの確認
devicename: 'ttyACM0',
bitrate: 9600
@uzimith
uzimith / Arduino.ino
Last active August 29, 2015 14:21
Open Web BoardでArduinoと通信する
/*
*/
const int OUTPUTS = 2;
byte pin[OUTPUTS] = {13, 12};
int current;
void setup()
{
// initialize the serial communication:
Serial.begin(9600);
for (int i=0; i < OUTPUTS+1; ++i) pinMode(pin[i], OUTPUT);
@uzimith
uzimith / sample.swift
Created May 17, 2015 00:11
swift random
//: Playground - noun: a place where people can play
import UIKit
var array = [1,2,3,4,5,6]
for i in 0..<10 {
if (array.isEmpty) {
array = [1,2,3,4,5,6]
}
var index = Int(arc4random() % UInt32(array.count))
var gulp = require('gulp')
var watchify = require('watchify');
var browserify = require('browserify');
var gutil = require('gulp-util');
var buffer = require('vinyl-buffer');
var source = require('vinyl-source-stream');
var sourcemaps = require('gulp-sourcemaps');
var streamify = require('gulp-streamify');
var uglify = require('gulp-uglify');