Skip to content

Instantly share code, notes, and snippets.

View sei0o's full-sized avatar

Seio Inoue sei0o

  • The University of Tokyo (eeic2023)
  • Tokyo, Japan (UTC+9)
  • 12:20 (UTC +09:00)
View GitHub Profile
@tetu1225
tetu1225 / app.rb
Created July 18, 2011 06:00
Sinatraで画像ファイルをアップロードして表示する
require 'sinatra'
require 'haml'
# 静的コンテンツ参照のためのパス設定
set :public, File.dirname(__FILE__) + '/public'
# アップロード
get '/' do
haml :index
@rkh
rkh / chat.rb
Created December 14, 2011 12:55
Simple Chat Application using the Sinatra Streaming API
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
get '/stream', provides: 'text/event-stream' do
@JasonGiedymin
JasonGiedymin / keygen.coffee
Created April 18, 2012 01:49
Basic KeyGen CoffeeScript
# Basic Keygen
# Briefly used at my startup
# Note: be mindful of any console logging or stdout logging when running this.
#
# By Jason Giedymin
# jasong _-@-_ apache -dot- org
#
crypto = require "crypto"
rbytes = require "rbytes"
@repeatedly
repeatedly / d_master.md
Last active June 8, 2023 06:20
D言語基礎文法最速マスター

他の言語をある程度知っている人はこれを読めばD言語の基礎をマスターでき,D言語の氷山の一角くらいは知ることができると思います.対象バージョンはdmd 2.059です.

1. 基礎

ソースファイル

ASCIIかUTFしか受け付けません.それ以外の文字コードで書くとコンパイルエラーになります.

main

D言語のmainはCとは違い以下のようなシグネチャです.

@sowawa
sowawa / .recipe
Created April 28, 2012 03:45
Installing rails 4.0.0 beta
thumbnail: http://pds.exblog.jp/pds/1/201101/16/02/d0055302_13383029.jpg
video: http://www.youtube.com/watch?v=UE27t_LJpx0
@nantekkotai
nantekkotai / gist:2841743
Created May 31, 2012 07:55
[iOS]CoreLocationで現在位置を取得する

CoreLocationを使ってGPSやらなにやらで現在位置を特定する。

Frameworkの追加

まずプロジェクトにCoreLocation.frameworkを追加する。

使用するファイルにimport

ここではサンプルとしてDemoViewControllerというものがあるとして、そこで位置取得を行う。

@mamantoha
mamantoha / style.rb
Created August 15, 2012 09:30
sinatra-flash and bootstrap alert
module Sinatra
module Flash
module Style
def styled_flash(key=:flash)
return "" if flash(key).empty?
id = (key == :flash ? "flash" : "flash_#{key}")
close = '<a class="close" data-dismiss="alert" href="#">×</a>'
messages = flash(key).collect {|message| " <div class='alert alert-#{message[0]}'>#{close}\n #{message[1]}</div>\n"}
"<div id='#{id}'>\n" + messages.join + "</div>"
end
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@hayajo
hayajo / changelog_en.md
Last active May 3, 2024 08:29
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形