Skip to content

Instantly share code, notes, and snippets.

View shinriyo's full-sized avatar

shinriyo shinriyo

View GitHub Profile
@yamakk
yamakk / google_weather_api.py
Created September 30, 2011 10:04
Google Weather APIから天候、湿度、風速、風向を取得する
#coding:utf-8
"""
unofficial Google Weather API
http://www.google.com/ig/api?weather=,,,35693692,139700260&hl=ja
レスポンスのエンコーディングは hl=jaの場合Shift-JIS hl=enの場合ASCII
<xml_api_reply version="1">
<weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0">
<forecast_information>
require "open-uri"
[
"http://pastebin.com/raw.php?i=Kc9ng18h",
"http://pastebin.com/raw.php?i=vCMndK2L",
"http://pastebin.com/raw.php?i=JdQkuYwG",
"http://pastebin.com/raw.php?i=fw43srjY"
].each do |url|
open(url).each_line do |line|
name, password = line.chomp.split(/:/)

node.jsのインストールから

node.js公式サイト

$ curl -L git.io/nodebrew | perl - setup

write this in your bashrc or zshrc.

@chrismccord
chrismccord / gist:cf51346c6636b5052885
Last active January 17, 2016 12:11
Phoenix 0.9 to 0.10.0 upgrade instructions

form_tag, link, CSRF changes

Plug 0.10.0 moves CSRF tokens from cookies back to sessions. To avoid future bumps on the road, a get_csrf_token/0 function has been added to controllers and imported into views. Update all your csrf token reference code to use the new function. Additionally, form_tag and link helpers have been added that will inject the csrf token for you automatically. You should transition to these new functions where possible, ie:

  <%= form_tag("/hello", method: :post) %>
    ... your form stuff. csrf is inject for you
  </form>
@totobook
totobook / YSlow使ってみたので使い方メモ.md
Created April 13, 2013 17:36
YSlow使ってみたのでメモ

YSlow for Chromeでサイト最適化

使い方メモ

概要

Yahoo!謹製のWebサイトパフォーマンス分析ツール

Firefox版Chrome版がある

FirefoxにはFirebugが必要

@dseg
dseg / Cargo.toml
Last active July 2, 2016 20:06
nickel Webフレームワークを使ってみる ref: http://qiita.com/dseg/items/66ec3bcecadb0317f85e
[package]
name = "nickel-helloworld-postgres"
version = "0.1.0"
authors = ["johndoe"]
[dependencies]
nickel = "*"
r2d2 = "*"
postgres = "*"
openssl = "*"
@webplumbr
webplumbr / vagrant-getting-started
Last active January 8, 2017 05:10
Getting started with Vagrant
# If you are on a VM (like me), I did the following on Peppermint 5 VM on VirtualBox.
sudo apt-get install vagrant virtualbox
# Make a directory named demo.
mkdir demo
cd demo
# add vagrant virtual box that can be used to initialize VM instances
@k-hoshina
k-hoshina / interface.md
Created January 11, 2017 10:05
interface{}のはなし

interface{}のはなし

goのinterfaceとは

方の定義とか関数の引数(あるいは帰り値)でよく使ってる

type Car interface {
  run(int)
  stop() bool
@opnchaudhary
opnchaudhary / numbertoword.js
Last active December 2, 2018 08:36
Converts Numbers to Words
// Convert numbers to words
// copyright 25th July 2006, by Stephen Chapman http://javascript.about.com
// permission to use this Javascript on your web page is granted
// provided that all of the code (including this copyright notice) is
// used exactly as shown (you can change the numbering system if you wish)
/*
Documentation: Usage
=====================
1. Import the javascript file:

freee API v1.0

全自動クラウド会計ソフトfreeeの開発者向けAPIのドキュメントです。

概要

本APIを利用することで、あなたのアプリやサービスをfreeeと連携させることができます。

提供機能(2013/10/10現在)