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
{ | |
'mongod': [ | |
{'ip': '1.2.3.4:1234'}, | |
{'ip': '1.2.3.4:1234'}, | |
{'ip': '1.2.3.4:1234'} | |
], | |
'config': [ | |
{'ip': '1.2.3.4:1234'}, | |
{'ip': '1.2.3.4:1234'}, |
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
{ | |
type: 'cluster', | |
members: [ | |
{ | |
type: 'shard', | |
members: [ | |
{ | |
type: 'mongod', | |
name: 'shard1' | |
}, |
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 | |
function monitor ($file) | |
{ | |
$last = filemtime($file); | |
$command = trim(`which php`); | |
$command .= " -f " . $file; | |
$command .= ' 2>&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
<?php | |
class Controller { | |
public function run () | |
{ | |
SomeLibrary::accidentalStatic(); | |
} | |
public function __toString () | |
{ |
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
$ git push `remote name` `local branch`:`remote_branch` |
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 | |
function ticks_counter ($return = null) | |
{ | |
static $ticks; | |
if ($return) { | |
return $ticks; | |
} |
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 | |
function bash_color($string, $color='white', $background='black') { | |
$colored_string = ""; | |
$_color['black'] = '0;30'; | |
$_color['dark_gray'] = '1;30'; | |
$_color['blue'] = '0;34'; | |
$_color['light_blue'] = '1;34'; |
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
$ apt-get source nginx | |
$ cd nginx* | |
$ patch -p1 < /patch | |
$ ... | |
$ dpkg-buildpackage -rfakeroot -uc -b |
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
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; | |
select * from big_data_table; | |
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; |
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 java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.io.OutputStreamWriter; | |
import java.net.URLConnection; | |
import java.net.URLEncoder; | |
import java.net.URL; | |
import java.util.Hashtable; | |
import java.util.Map; | |
import java.util.Iterator; |