This file contains hidden or 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 'sinatra' | |
| require 'digest/md5' | |
| # 個人用なのでいろいろ削った | |
| # オリジナルとクライアントのソース | |
| # https://github.com/gyazo/Gyazo | |
| post '/example/example/example' do | |
| imagedata = params['imagedata'][:tempfile].read |
This file contains hidden or 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
| use strict; | |
| use warnings; | |
| my @file = glob "*"; | |
| foreach my $f (@file){ | |
| if($f=~/(.*)\.(.*)/){ | |
| unless($2=~/jpg|png|gif|bmp|svg/){ | |
| &rename_img($f); | |
| } | |
| } |
This file contains hidden or 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
| require "rubygems" | |
| require "twitter" | |
| Twitter.configure do |config| | |
| config.consumer_key = YOUR_CONSUMER_KEY | |
| config.consumer_secret = YOUR_CONSUMER_SECRET | |
| config.oauth_token = YOUR_OAUTH_TOKEN | |
| config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET | |
| end |
This file contains hidden or 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
| // https://twitter.com/settings/design でブラウザのURL入ってるとこに入れて保存する | |
| // サイドバーと背景は透明になるけど流石にfontは消えなかった。transparentとか指定しても弾かれる | |
| javascript:d=document;d.getElementById("user_profile_sidebar_fill_color").value = '';d.getElementById("user_profile_sidebar_border_color").value = '';d.getElementById("user_profile_text_color").value = '';d.getElementById("user_profile_background_color").value = '';d.getElementById("user_profile_link_color").value = '';void(0); | |
| //chromeのURLバーに入れてもjavascript実行できなくなった。 | |
| //ブックマークレットにして使った方がよさそう。 | |
| javascript:d=document;d.getElementById("user_profile_sidebar_fill_color").value = '';d.getElementById("user_profile_sidebar_border_color").value = '';void(0); |
This file contains hidden or 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
| number_to_currency(3980000, :unit => "円", :format => "%n%u", :precision => 0) | |
| #=> 3,980,000円 |
This file contains hidden or 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 Nyan | |
| attr_accessor :piyo | |
| def test | |
| p piyo | |
| if false | |
| p "in!!!!!!!!!!!!!!" | |
| piyo = "wan!!" | |
| end | |
| p piyo |
This file contains hidden or 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' | |
| Twitter.configure do |config| | |
| config.consumer_key = YOUR_CONSUMER_KEY | |
| config.consumer_secret = YOUR_CONSUMER_SECRET | |
| config.oauth_token = YOUR_OAUTH_TOKEN | |
| config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET | |
| end |
This file contains hidden or 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
| require 'rubygems' | |
| require 'rmagick' | |
| width = 2048 | |
| height = 2048 | |
| Dir.mkdir("./resized") unless Dir.exist?("./resized") | |
| files = Dir.entries("./") | |
| files.each_with_index do |file,index| |
This file contains hidden or 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
| # 配列風の文字列を配列にする方法 | |
| str = "[1,'hoge']" | |
| ary = eval(str) #怖い.... | |
| ary = str[1..-2].split(',') | |
| # なんかいい方法ないかな |
This file contains hidden or 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
| use strict; | |
| use warnings; | |
| use Config::Pit; | |
| use Net::Twitter::Lite; | |
| use DateTime; | |
| use Encode; | |
| use utf8; | |
| my $now = DateTime->now; |
OlderNewer