Skip to content

Instantly share code, notes, and snippets.

@masaki925
masaki925 / s3_restore.rb
Created November 19, 2012 14:18
S3でGlacierにarchiveしたオブジェクトをrestoreするAPIを叩くスクリプト
#!/usr/bin/env ruby
require 'base64'
require 'net/http'
require 'openssl'
require 'time'
require 'digest/md5'
Net::HTTP.version_1_2
@masaki925
masaki925 / gmap_autocomplete.html
Last active December 11, 2015 19:18
simple use for google auto complete
<!DOCTYPE html>
<html>
<head>
<title>Google Maps JavaScript API v3 Example: Places Autocomplete</title>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
<script>
function initialize() {
var input = document.getElementById('searchTextField');
var autocomplete = new google.maps.places.Autocomplete(input);
}
@masaki925
masaki925 / convert_pw2tx.rb
Created July 31, 2013 06:37
convert from pukiwiki to textile
#!/usr/bin/ruby
filename = ARGV.shift
File.open(filename, 'r').each_line do |line|
puts line.sub(
'#highlighter(sh){{' , '<pre>' ).gsub(
/^\}\}/ , '</pre>' ).gsub(
/^#contents/ , '{{toc}}' ).gsub(
/^#contents/ , '{{toc}}' ).gsub(
@masaki925
masaki925 / convert_tx2pw.rb
Created July 31, 2013 06:38
convert from textile to pukiwiki
#!/usr/bin/ruby
filename = ARGV.shift
File.open(filename, 'r').each_line do |line|
puts line.sub(
/^<pre>/ , '#highlighter(){{').gsub(
/^<\/pre>/ , '}}').gsub(
'{{toc}}' , '#contents').gsub(
/^# / , '+ ' ).gsub(
@masaki925
masaki925 / find_spot_by_location.rb
Created November 6, 2013 02:38
see spot search result for Google and Facebook and Foursquare using Place API with location.
#!/usr/bin/env ruby
require 'net/https'
require 'uri'
require 'pry'
require 'json'
require 'logger'
require 'pp'
SSL_CERT_FILE = "/path/to/cacert.pem"
@masaki925
masaki925 / gist:7e32c467010323303b96
Last active August 29, 2015 14:03
iOS でFoursquare-API-v2 いじってみる

旅好き勉強会#3

  • ゴール

    • iPhone のMapView でオフィス近くで一杯やれる場所を探せるアプリ
  • cocoapods でfoursquare さがす

    • 2つあったけどアクティブなほうにした
  • 新しいアプリつくる

@masaki925
masaki925 / tabularize-0.html
Last active August 29, 2015 14:14
tabularize-0.html
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
var tabularize = function() {
var active = location.hash;
if(active) {
$(".tabs").children("div").hide();
$(active).show();
@masaki925
masaki925 / tabularize-x.html
Created January 27, 2015 07:23
tabularize-x.html
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
<body>
<div class="tabs">
<ul>
<li class="active"><a href="#tab1" class="tab-link">Tab 1</a></li>
<li><a href="#tab2" class="tab-link">Tab 2</a></li>
@masaki925
masaki925 / gist:52760bf734bb16516dc6
Last active August 29, 2015 14:23
CSS のお勉強(クラス セレクタの書き方)
<html>
<head>
<meta charset="utf-8">
<style>
.hoge1 {
color: red;
}
.hoge2.hoge3 {
background: red;
}
require "net/http"
require "uri"
proxy_addr = "localhost"
proxy_port = 3128
uri = URI.parse "http://www.ugtop.com/spill.shtml"
Net::HTTP.new(uri.host, uri.port, proxy_addr, proxy_port).start do |http|
request = Net::HTTP::Get.new(uri.request_uri)