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
CREATE FUNCTION fup_department_del() RETURNS TRIGGER AS ' | |
BEGIN | |
IF NEW.f_deleted=1 THEN | |
DELETE FROM department WHERE id=NEW.id; | |
END IF; | |
RETURN NEW; | |
END; | |
' LANGUAGE 'plpgsql'; | |
CREATE TRIGGER tup_department AFTER UPDATE ON department |
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
#! /bin/bash | |
url=http://localhost:5984 | |
rev() { | |
php -R '$a = json_decode($argn, true); echo $a[$argv[1]];' rev | |
} | |
curly() { | |
echo curl "$@" | |
curl -sS "$@" | |
} | |
curly $url |
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
$ python | |
Python 2.7.2+ (default, Oct 4 2011, 20:03:08) | |
[GCC 4.6.1] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> help | |
Type help() for interactive help, or help(object) for help about object. | |
>>> help() | |
Welcome to Python 2.7! This is the online help utility. |
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 | |
$tmhOAuth = __DIR__.'/tmhOAuth'; | |
if (!is_dir($tmhOAuth)) die("please run git clone https://github.com/themattharris/tmhOAuth.git $tmhOAuth\n"); | |
require $tmhOAuth . '/tmhOAuth.php'; | |
require $tmhOAuth . '/tmhUtilities.php'; | |
$config = array( | |
'consumer_key' => '', | |
'consumer_secret' => '', | |
'user_token' => '', | |
'user_secret' => '', |
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
top -b -n 1 | grep chrome | cut -c 46-50 | php -B '$sum=0;' -R '$sum += (float)$argn;' -E 'echo "sum=$sum\n";' |
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
Если надо протестировать работу сайта с вебкамерой, а вебкамеру использовать не катит (у меня она с флешем не дружит), можно установить ws4gl ( | |
WebcamStudio For GNU/Linux), запустить его, выбрать там предустановленную анимашку и наслаждаться. | |
Дополнительно, если флеш умирает после отображения диалога "разрешить сайту использовать камеру", можно добавить постоянное разрешение тут http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager09.html |
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
git checkout -b dev origin/dev |
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
call_user_func(function() { ... }); |
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 | |
return call_user_func(function() { | |
$app = new \Silex\Application(); | |
$routes = require(__DIR__ . '/routes.php'); | |
$routes($app); | |
return $app; | |
}); |
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 | |
class PHPUnitTest extends \PHPUnit_Framework_TestCase | |
{ | |
/** | |
* output of this test would be | |
* <cite> | |
* Failed asserting that 'cat does not have black fur' does not contain "cat does not have black fur". | |
* </cite> | |
* this is due to bad usage of PHPUnit_Framework_Constraint_Not::negate() |
OlderNewer