View killme.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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" |
View jason.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"errors" | |
"fmt" | |
"io/ioutil" | |
"os" | |
) |
View fizzbuzz.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
View private.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Nozaki | |
attr_reader :status | |
def initialize(status="嫌い") | |
@status = status | |
end | |
def 反対の | |
s = 好き? ^ true ? "好き" : "嫌い" | |
Nozaki.new(s) |
View interactive-git-checkout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
;; | |
*) |
View mdlink
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
url=$1 | |
title=`curl -s ${url} | grep -i '<title>' | sed -e 's/<[^>]*>//g' | sed -e 's/ //g'` | |
echo "[${title}](${url})" |
View float.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
OlderNewer