Skip to content

Instantly share code, notes, and snippets.

View pnlybubbles's full-sized avatar
🍋
is delicious!

pnly pnlybubbles

🍋
is delicious!
View GitHub Profile
@pnlybubbles
pnlybubbles / AppDelegate.rb
Created December 15, 2012 01:14
SheetDialogのテスト
#
# AppDelegate.rb
# DialogSheet
#
# Created by あわあわ on 12/12/15.
# Copyright 2012年 あわあわ. All rights reserved.
#
class AppDelegate
attr_accessor :window
@pnlybubbles
pnlybubbles / Happy_New_Year.rb
Created January 1, 2013 18:34
Happy New Year! Quine!
eval$s=%w'b="BAhsKwL8Af///////P////////3 //z////////l/////z//7//9//v/////w//7//5//BwAAAPz///8/4P 8BAAAA/w8AAAD4////D8D/+///D/ 4
fAAAA8P///wOQ//f//wP8v/9//+f//f8APP////8 B/P////7//wM AAP////8/AP/////9//8HAMD//// /H4D/////+// /DwDw/////wfg//////f//9//D// /
//8B+P//9//v//z////h//9/AP7//+//3//5// //P8z/H4D/f/ 4fAAAA8P////+D/wfg///8PwAAAO D/////P/8PAA A
A+H8AAADA/////3/+//////P//v//n///// ///P//////// ///////wP/// /
/H/j///8//v////8A+P///wfA////H/D ///9/AMD///8 DAP7//w/A4f//f3we////4/P4 //+fH4P////8 /
Pz//+fn5///P39+/////fn7///vz9 / //3/+fv7///v z8///35+f////eX78///35 /P//78/n//// wEA/P//3w/g////f gD///8DAPz/ /
/8e8P////eA ////5///////P/ z/// //4f///////////8f////////3//f//7/ ///8D/v//////5/8PAAAA////ATj8/ ////8D/HwAAAP7
///Nj8P///x +A/z8AAAD8///nz+////8DYP///+d//v//z9/P //9/APj////z//v//z/Pj////wP/////9
@pnlybubbles
pnlybubbles / alpha-kai.rb
Last active December 11, 2015 01:28
あるふぁーかいくんできたよー。 blacklist.csvでブラックリスト指定。 output.txtに書き出し。
# encoding: utf-8
require 'rubygems'
require 'net/https'
require 'openssl'
require 'oauth'
require 'cgi'
require 'json'
# コンシュマーキーとアクセストークン
@pnlybubbles
pnlybubbles / inisitalize_environment.sh
Created February 13, 2013 06:58
zsh環境整えるシェルスクリプトLion用
#!/bin/bash
echo "\033[1;36m===>\033[0;39m \033[1mInstalling homebrew\033[0;39m"
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
echo "\033[1;36m===>\033[0;39m \033[1mInstalling tmux\033[0;39m"
brew install tmux
echo "\033[1;36m===>\033[0;39m \033[1mInstalling zsh\033[0;39m"
brew install zsh
echo "\033[1;36m===>\033[0;39m \033[1mEditing /etc/shells\033[0;39m"
sudo sh -c "echo '/usr/local/bin/zsh' >> /etc/shells"
@pnlybubbles
pnlybubbles / initialize_ruby_environment.sh
Created February 13, 2013 16:59
rbenv環境を整えるシェルスクリプトLion用 ruby-1.9.3-p385のみインストール
#!/bin/bash
echo "\033[1;36m===>\033[0;39m \033[1mInstalling openssl\033[0;39m"
brew install openssl
echo "\033[1;36m===>\033[0;39m \033[1mInstalling readline\033[0;39m"
brew install readline
echo "\033[1;36m===>\033[0;39m \033[1mInstalling rbenv\033[0;39m"
brew install rbenv
echo "\033[1;36m===>\033[0;39m \033[1mInstalling ruby-build\033[0;39m"
brew install ruby-build
@pnlybubbles
pnlybubbles / kosii.rb
Last active December 13, 2015 23:59
コシィ...
# encoding: utf-8
require './twitter-config.rb'
t = []
rand(20).downto(0) { |i|
text = "コシィ" * i + "..."
puts text
t[i] = Thread.new {
@pnlybubbles
pnlybubbles / t.rb
Created March 9, 2013 08:45
Rubyの投稿専用クライアント(CUI) ・Requirement: Twitter gem ・コンスマなどは自分で ・140文字自動分割 ・フッター設定(例 foot:#yuruyuri) ・ぐちゃぐちゃ
# encoding: utf-8
require 'twitter'
Twitter.configure do |config|
config.consumer_key = ''
config.consumer_secret = ''
config.oauth_token = ''
config.oauth_token_secret = ''
end
puts "#### post only twitter client t.rb ####"
def t() $o||="";loop{((x=gets.chomp.strip).empty?.!&&(x=~/^foot:/).nil?) ? h=Thread.new{catch(:s){loop{(Twitter.update((x.length-(c||=0)*(140-((f=$o.empty?.!) ? l=1+$o.length : 0)))>0 ? lambda{c+=1;return x[(c-1)*140,140-(f ? l : 0)]+(f ? " "+$o : "")}.call : lambda{puts "=> tweet with separating" if c>1;throw :s}.call));redo}} rescue puts "=> error: #{$!}"} : (($o=x.gsub(/foot:/,"");puts "=> footer: #{$o}") if x=~/^foot:/)};end
@pnlybubbles
pnlybubbles / ADN_scraping.rb
Created March 13, 2013 12:12
App.netのMyStreamをスクレイピングで取得してみた。
# encoding: utf-8
require 'mechanize'
USERNAME = '*'
PASSWORD = '*'
cookie_path = './tmp/adn_client.cookie.yaml'
target = '*'
@pnlybubbles
pnlybubbles / AppDelegate.rb
Last active December 15, 2015 17:58
MacRubyでTwitter gemうまく動かないメモ。(MacRuby 0.12 (ruby 1.9.2) [universal-darwin10.0, x86_64], macgem 1.8.20, twitter gem (4.6.2))
#
# AppDelegate.rb
# TwitterGemTest
#
# Created by あわあわ on 13/04/03.
# Copyright 2013年 あわあわ. All rights reserved.
#
require "rubygems"
require "twitter"
@pnlybubbles
pnlybubbles / reply_arr.rb
Created April 5, 2013 13:31
RTした人にリプライ送る...。
# encoding: utf-8
require "./twitter-config.rb"
ID = 320165046791577600
rt = []
$pn1y.retweets(ID).each{ |res|
rt.push(res.user.screen_name)