This file contains 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
#!/usr/bin/env bash | |
pidFile=~/test1 | |
if [ ! -s ${pidFile} ];then | |
echo 'not exist or empty, touch this file' | |
touch ${pidFile} | |
fi | |
This file contains 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
!function(e){e.save=function(o,n){if(!o)return void e.error("Console.save: No data");n||(n="console.json"),"object"==typeof o&&(o=JSON.stringify(o,void 0,4));var t=new Blob([o],{type:"text/json"}),a=document.createEvent("MouseEvents"),s=document.createElement("a");s.download=n,s.href=window.URL.createObjectURL(t),s.dataset.downloadurl=["text/json",s.download,s.href].join(":"),a.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),s.dispatchEvent(a)}}(console);var d=document,b=d.createElement("script");b.src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js",d.getElementsByTagName("head")[0].appendChild(b);var s="";$("div._2uju6").each(function(){s+=$(this).text(),s+="\n"}),console.save(s); |
This file contains 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 'net/http' | |
require 'uri' | |
require 'nokogiri' | |
require 'byebug' | |
PREFIX= "https://www.google.co.jp/search?q=" | |
QUERY = "+日の出+日の入り" |
This file contains 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 'atom' | |
require 'json' | |
require 'uri' | |
require 'net/http' | |
API_URL_PREFIX = "https://api.github.com/repos/" | |
URL_PREFIX = "https://github.com/" | |
language_stack = {} | |
language_count = {} |
This file contains 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
//: Playground - noun: a place where people can play | |
import UIKit | |
var str = "Hello, playground" | |
print("hello world") | |
// -- | |
var myVariable = 42 |
This file contains 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
胆振综合振兴局 | |
市部:室兰市、苫小牧市、登别市、伊达市 | |
虻田郡:丰浦町、洞爷湖町 | |
有珠郡:壮瞥町 | |
白老郡:白老町 | |
勇拂郡:安平町、厚真町、鹉川町(原名:むかわ町) |
This file contains 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
# | |
# Returns the number of threads waiting on the queue. | |
# | |
def num_waiting | |
@num_waiting | |
end | |
end | |
# when init EM env, there is a thread pool would be inited | |
# with default configutation. the `num_waiting` would be set as that value |
This file contains 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
Circuit_breaker(断路器) | |
https://en.wikipedia.org/wiki/Circuit_breaker | |
###马丁说 | |
http://martinfowler.com/bliki/CircuitBreaker.html | |
###in ruby |
This file contains 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
SET !ERRORIGNORE YES | |
VERSION BUILD=8961227 RECORDER=FX | |
TAB T=1 | |
URL GOTO=http://www.weibo.com/#{your nick name}/profile | |
WAIT SECONDS=3 | |
TAG POS=2 TYPE=I ATTR=TXT:c | |
TAG POS=1 TYPE=A ATTR=TXT:删除 | |
TAG POS=1 TYPE=SPAN ATTR=TXT:确定 | |
# 上面的版本造成过多刷新载入页面,速度太慢 |
This file contains 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 'faraday' | |
require 'json' | |
connection = Faraday.new('http://www3.nhk.or.jp') do |builder| | |
builder.request :url_encoded | |
builder.response :logger | |
builder.adapter Faraday.default_adapter | |
end | |
begin |