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
145750 flavius │ Hi. How to count the number of files in a directory (for a conditional "if there are any files in the directory, do │ Chiku|dc | |
│ this"), without spawning a subprocess like ls? │ chris2 | |
145938 ccxCZ │ > files=( *(N) ); echo $#files │ Chryyz | |
145939 SweetieBot │ ccxCZ: 0 │ chutzpah | |
150011 ccxCZ │ though that doesn't get .files │ cinch | |
150111 flavius │ ccxCZ: and where do I put the path to the directory? │ claytron | |
150114 Mikachu │ (DN) |
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
" HJKL repetition trap | |
" Barry Arthur, 2013-03-14 | |
" depends on your :help 'updatetime setting | |
let g:cursor_moving = 0 | |
function! TrapMovementKeys(key) | |
augroup CursorMoving | |
au! | |
autocmd CursorMoved * let g:cursor_moving = 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 | |
/** | |
* File: database.class.php | |
* Super simple PDO class | |
* | |
* Author: Jeremy Morgan | |
* Author: Flavius Aspra <[email protected]> | |
* | |
* This is just a start. No error handling or parameterization yet | |
*/ |
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 | |
$url = 'http://forum.antichat.ru/thread20301.html'; | |
function getfile($url,$num) { | |
echo "$url"; | |
$content = file_get_contents($url); | |
echo nl2br($content); | |
$fp = fopen($num.".txt", 'write'); | |
fwrite($fp, nl2br($content)); | |
fclose($fp); | |
return $content; |
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
function! ToggleFlagOptionValue(option, flag) | |
exe "set " . a:option . eval("&" . a:option . " =~# '" . a:flag . "' ? '-=" . a:flag . "' : '+=" . a:flag . "'") | |
endfunction | |
echo &go | |
call ToggleFlagOptionValue('go', 'T') | |
call ToggleFlagOptionValue('go', 'r') | |
echo &go | |
# for flag in ['T', 'r'] | call ToggleFlagOptionValue('go', flag) | endfor |
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
src |
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
tioiutou |
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 | |
namespace demo; | |
class Bar { | |
protected $options; | |
public function __construct($options = null) { | |
$this->options = $options; | |
} | |
} |
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 | |
return array( | |
'modules' => array( | |
'Application', | |
), | |
'module_listener_options' => array( | |
'config_cache_enabled' => false, | |
'cache_dir' => 'data/cache', | |
'module_paths' => array( | |
'./modules', |
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 | |
$createLink = function($var) { | |
$ret = '<a style="color: red" href="' . $var . '">' . 'Link' . '</a>'; | |
return $ret; | |
}; | |
$format = array(); | |
$format['Link'] = 'createLink'; |