Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Yuto MIZUSHIRI mizukmb

🏠
Working from home
  • Yayoi Co., Ltd.
  • Aichi, Japan
  • Twitter @mizukmb
View GitHub Profile
View killme.rb
# -*- coding: utf-8 -*-
require "twitter"
require 'open-uri'
require 'nokogiri'
CONSUMER_KEY = "あなたのCONSUMER_KEY"
CONSUMER_SECRET = "あなたのCONSUMER_SECRET"
OAUTH_TOKEN = "あなたのOAUTH_TOKEN"
OAUTH_TOKEN_SECRET = "あなたのOAUTH_TOKEN_SECRET"
@mizukmb
mizukmb / jason.go
Created Mar 7, 2015
13日の金曜日をjson形式で出力します
View jason.go
package main
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
)
@mizukmb
mizukmb / fizzbuzz.exs
Last active Aug 29, 2015
Written by Elixir
View fizzbuzz.exs
defmodule FizzBuzz do
def fizzbuzz(num) when rem(num, 15) == 0, do: "fizzbuzz"
def fizzbuzz(num) when rem(num, 3) == 0, do: "fizz"
def fizzbuzz(num) when rem(num, 5) == 0, do: "buzz"
def fizzbuzz(num), do: Integer.to_string num
end
Enum.each(1..100, fn(i) ->
IO.puts FizzBuzz.fizzbuzz(i)
end)
@mizukmb
mizukmb / private.xml
Created Sep 8, 2015
Setting file of KeyRemap4MacBook
View private.xml
<?xml version="1.0"?>
<root>
<item>
<name>For HHKB Pro2</name>
<item>
<name>Shift_R to Underscore for US Keyboard</name>
<identifier>remap.my_hhkb_us_shift_r_to_underscore</identifier>
<autogen>__KeyToKey__ KeyCode::SHIFT_R, ModifierFlag::SHIFT_R | ModifierFlag::NONE, KeyCode::MINUS, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::SHIFT_R, ModifierFlag::SHIFT_L, KeyCode::MINUS, ModifierFlag::SHIFT_L</autogen>
</item>
View sparql-graph.py
# coding: utf-8
from SPARQLWrapper import SPARQLWrapper, JSON
import pygraphviz as pgv
# sparql endpointの設定
sparql = SPARQLWrapper("http://ja.dbpedia.org/sparql")
sparql.setQuery("""
SELECT DISTINCT ?label ?iblabel
WHERE {
?s rdf:type dbpedia-owl:ProgrammingLanguage;
View json-ld.txt
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Blog",
"alternativeHeadline": "{{ if not .IsHome }}{{ humanize .Title }} | {{ end }}{{ .Site.Title | plainify }}",
"url": "{{ .Site.BaseURL }}",
"image": "{{ .Site.BaseURL }}/images/mizukmb.png",
"author": {
"@type": "Person",
"name": "mizukmb",
View nozaki.rb
class Nozaki
attr_reader :status
def initialize(status="嫌い")
@status = status
end
def 反対の
s = 好き? ^ true ? "好き" : "嫌い"
Nozaki.new(s)
View interactive-git-checkout
#!/bin/bash
case "$1" in
-a|--all)
git branch --sort=-authordate -v -a | peco | sed -e 's/*/ /' | sed -e 's/ //' | cut -d ' ' -f1 | xargs git checkout
;;
-r|--remotes)
git branch --sort=-authordate -v -r | peco | sed -e 's/*/ /' | sed -e 's/ //' | cut -d ' ' -f1 | xargs git checkout
;;
*)
@mizukmb
mizukmb / mdlink
Last active Feb 2, 2017
Create a markdown format link.
View mdlink
View float.rb
# x.yE+-z 形式の浮動小数点定数を読み込む
# e.g 12.3E-1, .333E+3
class MzFloat
def initialize(num)
@chars = num.split('')
@index = 0
@ch = chars[index]
@sign = '+'
@b = 0