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
var event = e || window.event; | |
var k = event.keyCode; | |
if((event.ctrlKey == true && k == 82) || (event.ctrlKey == true && k == 78) || (k == 116) || (event.ctrlKey == true && k == 116)) | |
{ | |
event.keyCode = 0; | |
event.returnValue = false; | |
event.cancelBubble = true; | |
return false; | |
} |
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
<?php | |
// 欧几里得度量_百度百科 http://baike.baidu.com/link?url=zAEZl46AoeKqIg0v1n_nPWP5JycEYvoOepRf_lTin_i-nb9YTNQGOFILLYYqTxF3Nho0Wn5vWgNWTYHklq0mE_ | |
function distance() | |
{ | |
$argv = func_get_args(); | |
$argc = func_num_args(); | |
if ($argc !== sizeof($argv)) return; | |
$res = $j = intval(NULL); | |
for (; $j < sizeof($argv[0]); $j++) |
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
scala> (0/:(0 to 100))((s,i)=>s+i%2*i*i) |
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
import play.api.db.evolutions.Evolutions | |
import play.api.db.DBPlugin | |
import play.api.db.evolutions.InconsistentDatabase | |
import play.api.test.FakeApplication | |
import org.specs2.mutable._ | |
import org.specs2.runner._ | |
import org.junit.runner._ | |
/** |
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
ssh-keygen -R [hostname] | |
ssh-keygen -R [ip_address] | |
ssh-keygen -R [hostname],[ip_address] | |
ssh-keyscan -H [hostname],[ip_address] >> ~/.ssh/known_hosts | |
ssh-keyscan -H [ip_address] >> ~/.ssh/known_hosts | |
ssh-keyscan -H [hostname] >> ~/.ssh/known_hosts |
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
/** | |
* This action is used to serve Home page of the application | |
* | |
* @return | |
*/ | |
def index = Action { implicit request => | |
Ok(views.html.index("Your new application is ready.")) | |
} | |
/** |
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 cover(rs: Range*):Int = ??? | |
assert(cover(0 to 4, 1 to 5) == 6) | |
assert(cover(0 to 4, 1 to 3) == 5) | |
assert(cover(0 to 4, 6 to 7) == 7) | |
assert(cover(0 to 4, 6 to 7, 2 to 6) == 8) | |
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
select | |
sum(pg_column_size(the_text_column)) as total_size, | |
avg(pg_column_size(the_text_column)) as average_size, | |
sum(pg_column_size(the_text_column)) * 100.0 / pg_relation_size('t') as percentage | |
from t; |
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
// ディレクトリのみ | |
ls -F | grep / | |
// ファイルのみ | |
ls -F | grep -v / |
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
$ defaults write com.apple.finder AppleShowAllFiles TRUE |
OlderNewer