Skip to content

Instantly share code, notes, and snippets.

View ppworks's full-sized avatar
🏠
Working from home

Naoto Koshikawa ppworks

🏠
Working from home
View GitHub Profile
@corocorococoro
corocorococoro / NSString+Zenkakukana.h
Last active December 20, 2015 11:09
半角カナを全角カナにする。 NSString* strHankaku = @"アイウエオ"; NSString* strZenkaku = str.convertToZenkakukana; // strZenkaku → アイウエオ
@interface NSString(NSStringAddition)
- (NSString *)convertToZenkakukana;
@end
@implementation NSString(NSStringAddition)
- (NSString *)convertToZenkakukana
{
NSMutableString *target =self.mutableCopy;
@frans-k
frans-k / wercker.yml
Last active October 31, 2018 20:16
My wercker.yml for Rails 4, Ruby 2, Postgresql, Rspec, Heroku deploy and automatic Heroku migrations. Had some issues with it, so hopefully it's helpful to someone.
box: wercker/ubuntu12.04-ruby2.0.0
services:
- wercker/postgresql
build:
steps:
- bundle-install
- rails-database-yml:
service: postgresql
@afeld
afeld / gist:5704079
Last active November 27, 2023 15:43
Using Rails+Bower on Heroku
@emsk
emsk / notes.rake
Created March 25, 2013 06:33
rake notes 探索対象ディレクトリに spec ディレクトリを追加
class SourceAnnotationExtractor
def find_with_custom_directories
find_without_custom_directories(%w(app config lib script test spec))
end
alias_method_chain(:find, :custom_directories)
end
@mala
mala / gist:5107120
Last active March 19, 2020 01:41
TwitterのOAuthの問題の補足とか

https://gist.github.com/mala/5062931

の続き。

Twitterの人に色々と問題点は伝えたんだけど、これからOAuthのサーバー書く人や、クライアント書く人が似たような問題を起こさないようにするために、どうすればいいのかについて簡単に書きます。既存の実装真似して作るとうっかりひどい目にあう。

自分は意図的に「Twitterの脆弱性」という表現を使わないように気を使っていて、それはクライアントアプリ側の責任もあるからなのだけれども、安全に実装するための方法がわかりにくかったり誤解を招きやすかったり、Twitterに買収されているTweetDeckにも問題があったりしたので、それはやっぱりTwitter側の責任の比重が大きいとは思う。とはいっても別に責任を追求したかったり◯◯はクソだといったことを言いたいわけではなく、誰が悪いとか言う以前に、複合的な要因によって問題が起きるときには原因を正しく理解する必要があると思う。

そもそも何を担保に安全性を保証しているのか

  • サーバー側で秘密の鍵を持っている(それが無いとアクセストークンを取得できない or 使えない)
@fukajun
fukajun / gist:4222284
Created December 6, 2012 06:48
Letの効果的な使い方
describe "hoge" do
bofore do
get "index" , value
end
context "範囲内に収まるパラメータがくる" do
let (:value) { 123 }
it { response.should eq true }
end
context "範囲内に収まっていないパラメータがくる" do
let (:value) { 123456 }
@joekiller
joekiller / gtk-firefox.sh
Last active October 21, 2021 04:15 — forked from phstc/gtk-firefox.sh
INSTALL FIREFOX ON AMAZON LINUX X86_64 COMPILING GTK+
#!/bin/bash
# GTK+ and Firefox for Amazon Linux
# Written by Joseph Lawson 2012-06-03
# http://joekiller.com
# http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/
# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh
@taea
taea / balloon_mixin.sass
Last active October 12, 2016 06:58
balloon mixin : 1行でふきだしの三角部分が書けるmixin
/* balloon
=balloon-left($size: 6px, $color: #FFF, $top: 6px)
position: relative
&:after
position: absolute
content: ""
display: block
border: $size solid transparent
border-right: $size solid $color
top: $top
@subelsky
subelsky / puma_rails_heroku.rb
Created October 31, 2012 13:51
Setting up Puma and Rails on Heroku
# Gemfile
gem "puma"
# Procfile
web: bundle exec puma -p $PORT -e $RACK_ENV -C config/puma.rb
# add to config block config/environments/production.rb
config.threadsafe!
# get rid of NewRelic after_fork code, if you were doing this:
@hayajo
hayajo / changelog_en.md
Last active May 3, 2024 08:29
ChangeLog を支える英語

ChangeLog を支える英語

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

ほとんど引用です。

基本形