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
tar -zcvf stuff.tar.gz ~/* \ | |
&& scp stuff.tar.gz xobb@lviv:stuff.tar.gz \ | |
&& rm -rf ~/* \ | |
&& ssh xobb@lviv \ | |
&& tar -zxvf stuff.tar.gz |
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 | |
//Шлях до файла. | |
$files = file('songs.html'); | |
//рахуємо кількість файлів | |
$count = count($files); | |
//Понеслись! | |
for ($i = 0; $i < $count; $i++) { | |
//Забрали теги нафіг і стрімили перевод строчки | |
$source = trim(strip_tags($files[$i])); | |
// Написали якусь каляку шо робиться |
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 | |
// Вішаємось на післяроутингу | |
// це викличе нашу функцію коли роутинг закінчиться | |
Event::add('system.post_routing' ,'call_fallback_page'); | |
function call_fallback_page() | |
{ | |
// визначаємо чи наразі визначений контроллер | |
if (Router::$controller === NULL) { | |
// контроллера нема, якраз наш випадок! | |
Router::$controller = 'page'; |
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 | |
$reg_exp = '#<a [^>]*href=\\?[\'"](?P<url>http:\/\/[0-9a-z]+\.[0-9a-z]{5,10}\.(pay|hop)\.clickbank\.net)\\?[\'"][^>]*>#is'; | |
$text = ' | |
ololololol trolololololol | |
<a href=\"http://123.ololo.pay.clickbank.net\">ololol trololo</a> | |
<a href=\"http://affiliate.ol00lo.hop.clickbank.net\">ololo trololo</a> | |
'; | |
$matches = array(); |
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 | |
/* | |
Plugin Name: GistPress | |
Plugin URI: http://wordpress.org/extend/plugins/github-gist | |
Description: Embed your gists to posts | |
Usage: add gist id and file (if required) | |
[gist id="847852" file="gistpress.php"/] | |
Version: 0.1 |
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 remote add upstream https://github.com/mattrude/wordpress.git | |
git fetch upstream | |
git checkout -b integration | |
git merge --no-ff upstream/3.1 |
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
SELECT | |
anmeldelser.billed_sti , | |
anmeldelser.overskrift , | |
anmeldelser.indhold , | |
anmeldelser.id , | |
anmeldelser.godkendt, | |
FROM | |
anmeldelser | |
UNION SELECT | |
nyheder.id , |
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 | |
function do_shortcode($content) { | |
global $shortcode_tags; | |
if (empty($shortcode_tags) || !is_array($shortcode_tags)) | |
return $content; | |
$pattern = get_shortcode_regex(); | |
return preg_replace_callback('/'.$pattern.'/s', 'do_shortcode_tag', $content); | |
} |
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 | |
// ... | |
// Example A - Load user model directly in traditional style | |
$user_a = new User('[email protected]') | |
->load($db); | |
// Example B - Load user model using HMVC style | |
$user_b = Request::factory('users/[email protected]') | |
->method('GET') | |
->header('Accept', 'application/json') |
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 | |
// .... bootstap.php | |
Route::set('messages', 'messages/<action>/<user>(<format>)', array('format' => '\.\w+')) | |
->defaults(array( | |
'format' => '.json', | |
'controller' => 'messages', | |
)); | |
// .... bootstrap.php |