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
| #!/bin/bash | |
| # | |
| # /etc/rc.d/init.d/growthforecast | |
| # | |
| # chkconfig: - 80 20 | |
| # description: growthforecast | |
| # processname: growthforecast | |
| # pidfile: /var/run/growthforecast/growthforecast.pid | |
| # | |
| ### BEGIN INIT INFO |
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 'net/http' | |
| Net::HTTP.get(URI.parse('http://yonekawa711.blog22.fc2.com/')).force_encoding('UTF-8').scan(/『.+?『.+?。/m)[0].gsub(/\<.+?\>/,'') |
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
| # vim: ft=ruby fileencoding=utf-8 | |
| # -------------------------------------------------- | |
| # Notifier to screen | |
| # -------------------------------------------------- | |
| def hardstatus | |
| status = open("#{ENV['HOME']}/.screenrc"){|f| f.grep(/^hardstatus/)[-1] } || "" | |
| status.chomp.rstrip | |
| 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
| #!/bin/sh | |
| git diff --cached | grep -E '^\+.*\bp(ry)?\b' && echo 'p or pry may exist.' && exit 1 |
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 "struct_module/version" | |
| module StructModule | |
| class << self | |
| def generate_module(attrs) | |
| Module.new{|mod| | |
| @_members = attrs | |
| def self.included(base) |
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' | |
| itms_url = 'itms-apps://itunes.apple.com/jp/genre/id6014' | |
| get '/' do | |
| return <<-HTML | |
| <html> | |
| <head> | |
| <title>ITMSリダイレクト挙動サンプル</title> |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script> | |
| window.onload = function(){ | |
| document.getElementById('d').innerHTML = 'xxxxxxxxxx'; | |
| window.open("about:blank","_self").close(); | |
| // window.close(); | |
| }; | |
| </script> |
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
| def generate_name | |
| begin | |
| name = Digit.generate(6) | |
| end while Image.exists?(name: name) | |
| name | |
| end | |
| def generate_name | |
| loop do | |
| name = Digit.generate(6) |
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
| curl -u USERNAME https://api.github.com/orgs/ORGNAME/members | ruby -rjson -e 'o = JSON.parse(ARGF.read); puts o.map{|i| i["login"]}' |