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" |
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" | |
) |
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) |
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> |
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})" |
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; |
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", |
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) |
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 | |
;; | |
*) |
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