Takesi SASAKI @ Quipper @dagezi
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
(defun github-url-decompose (file &optional partial) | |
(cond | |
((file-directory-p (expand-file-name ".git" file)) (cons file partial)) | |
((equal "/" file) nil) | |
(t (github-url-decompose (directory-file-name (file-name-directory file)) | |
(if partial | |
(concat (file-name-nondirectory file) "/" partial) | |
(file-name-nondirectory file)))))) | |
(defun github-url-get-origin (dir) |
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
(defun github-url-decompose (file &optional partial) | |
(cond | |
((file-directory-p (expand-file-name ".git" file)) (cons file partial)) | |
((equal "/" file) nil) | |
(t (github-url-decompose (directory-file-name (file-name-directory file)) | |
(if partial | |
(concat (file-name-nondirectory file) "/" partial) | |
(file-name-nondirectory file)))))) | |
(defun github-url-get-origin (dir) |
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
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting | |
documentation at http://bit.ly/bundler-issues. Thanks! | |
/var/lib/gems/2.0.0/gems/bundler-1.5.1/lib/bundler/installer.rb:326:in `install_in_parallel': undefined method `[]' for nil:NilClass (NoMethodError) | |
from /var/lib/gems/2.0.0/gems/bundler-1.5.1/lib/bundler/installer.rb:95:in `run' | |
from /var/lib/gems/2.0.0/gems/bundler-1.5.1/lib/bundler/installer.rb:15:in `install' | |
from /var/lib/gems/2.0.0/gems/bundler-1.5.1/lib/bundler/cli.rb:257:in `install' | |
from /var/lib/gems/2.0.0/gems/bundler-1.5.1/lib/bundler/vendor/thor/command.rb:27:in `run' | |
from /var/lib/gems/2.0.0/gems/bundler-1.5.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_command' | |
from /var/lib/gems/2.0.0/gems/bundler-1.5.1/lib/bundler/vendor/thor.rb:363:in `dispatch' | |
from /var/lib/gems/2.0.0/gems/bundler-1.5.1/lib/bundler/vendor/thor/base.rb:438:in `start' |
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
package hoge; | |
import rx.*; | |
import rx.schedulers.*; | |
import java.util.concurrent.TimeUnit; | |
// See the items in backpressure bufffer will be genereated | |
// for the observer who subscribed later? | |
public class SubscribeLater { |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<svg | |
xmlns="http://www.w3.org/2000/svg" | |
xmlns:xlink="http://www.w3.org/1999/xlink" | |
width="40px" height="40px" viewBox="0 0 40 40" version="1.1" > | |
<path | |
d="M10,10 30,10 30,30 10,30 Z M15,15 25,15 25,25 15,25 Z" | |
fill="#ff0000" fill-rule="evenOdd" /> | |
</svg> |
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
# Trivial example: 2017-01-01 is part of the last week of 2016 because ISO week starts with the Monday. | |
irb(main):004:0> fd2017 = Date.new(2017,1,1) | |
=> #<Date: 2017-01-01 ((2457755j,0s,0n),+0s,2299161j)> | |
irb(main):005:0> fd2017.cweek | |
=> 52 | |
irb(main):006:0> fd2017.cwday | |
=> 7 # Sunday | |
irb(main):007:0> fd2017.cwyear | |
=> 2016 |
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
import java.lang.ref.WeakReference; | |
public class Www { | |
public static void main(String args[]) { | |
Runnable r0 = create0(); | |
Runnable r1 = create1(); | |
System.gc(); | |
r0.run(); | |
r1.run(); |
It's very desired that every commit in the branch is organized well. One commit changes only one logical part. It shouldn't contain irrevant changes, such as one for UI and another for DB. Such changes must be separated into different commits.
- It makes review easier.
- It would help you dividing the big PR to a few logical PRs.
- It makes easier to remove one logical change.
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
# https://en.wikipedia.org/wiki/MOI_(file_format) | |
def get_date_from_moi(moi) | |
File.open(moi, "rb") { |file| | |
file.seek(6) | |
bytes = file.read(10) | |
y, mon, d, h, min, ms = bytes.unpack('nCCCCn') | |
return Time.new(y, mon, d, h, min, ms/1000) | |
} | |
end |