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
var merge = function(obj1, obj2) { | |
var ret = obj1; | |
for(index in obj2) { | |
ret[index] = obj2[index]; | |
} | |
return ret; | |
}; |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,5c,e0,3a,00,00,00,00,00 |
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
" copy all this into a vim buffer, save it, then... | |
" source the file by typing :so % | |
" Now the vim buffer acts like a specialized application for mastering vim | |
" There are two queues, Study and Known. Depending how confident you feel | |
" about the item you are currently learning, you can move it down several | |
" positions, all the way to the end of the Study queue, or to the Known | |
" queue. | |
" type ,, (that's comma comma) |
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 @source_db = 'db1'; | |
SET @target_db = 'db2'; | |
SELECT | |
'Only in source' exist_type, | |
c1.table_schema, c1.table_name, c1.column_name, c1.ordinal_position, c1.column_default, c1.is_nullable, c1.numeric_precision, c1.numeric_scale, c1.character_set_name, c1.collation_name, c1.column_type, c1.column_key, c1.extra, c1.column_comment | |
FROM | |
(SELECT * FROM information_schema.columns WHERE TABLE_SCHEMA = @source_db) c1 | |
LEFT JOIN (SELECT * FROM information_schema.columns WHERE TABLE_SCHEMA = @target_db) c2 | |
ON c1.TABLE_name = c2.TABLE_name AND c1.column_name = c2.column_name |
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
mysqldump -u root -p[password] [db_src] | mysql -u root -p[password] [db_dest] |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
public static function error_handler($errno, $errstr, $errfile, $errline, $errcontext) { | |
global $errorLog; | |
if (is_array($errstr) || is_object($errstr)) { | |
$errstr = var_export($errstr, true); | |
} | |
$message = "$errno:$errfile:$errline:$errstr:".json_encode($errcontext); | |
if (isset($errorLog) && get_class($errorLog)==='Devtools\Log') { | |
$errorLog->write($message, false); | |
} else { | |
echo $message; |
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
<?php | |
define(MQ_SEND_ACCESS , 2); | |
define(MQ_DENY_NONE , 0); | |
$msgQueueInfo = new COM("MSMQ.MSMQQueueInfo") or die("can not create MSMQ Info object"); | |
$msgQueueInfo->PathName = ".\TestQueue"; | |
$msgQueue = new COM("MSMQ.MSMQQueue") or die("can not create MSMQ object"); | |
$msgQueue=$msgQueueInfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE ); | |
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! TagbarGotoTag() | |
normal! "zyiw | |
call tagbar#OpenWindow('fcj') | |
:exe "/".@z."" | |
" Need to send a carriage return here to select the tag | |
:nohlsearch | |
endfunction |
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
interface Entity {} | |
class UserEntity implements Entity {} | |
interface Repository | |
{ | |
public function persist(Entity $entity); | |
} | |
class UserRepository implements Repository | |
{ |
OlderNewer