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 | |
// Place the DB files outside of the public web directory so people don't download it! | |
define('DB', 'links.sq3'); | |
// Number of seconds a user must wait to post another link (false to disable) | |
define('WAIT', false); | |
// Should we enforce IP checking? (false to disable) | |
define('IP_CHECK', false); |
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 | |
define('START_TIME', microtime(TRUE)); | |
register_shutdown_function(function() { | |
print dump(round(microtime(TRUE) - START_TIME, 3) . ' seconds'); | |
print dump(round(memory_get_peak_usage() / 1024) . " kb peak usage"); | |
print dump(DB::$q); | |
}); |
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 | |
/** | |
* Parse the text with *limited* markdown support. | |
* | |
* @param string $text | |
* @return string | |
*/ | |
function markdown_limited($text) | |
{ | |
// Make it HTML safe for starters |
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 mb_substr_replace($string, $replacement, $start, $length=NULL) { | |
if (is_array($string)) { | |
$num = count($string); | |
// $replacement | |
$replacement = is_array($replacement) ? array_slice($replacement, 0, $num) : array_pad(array($replacement), $num, $replacement); | |
// $start | |
if (is_array($start)) { | |
$start = array_slice($start, 0, $num); | |
foreach ($start as $key => $value) |
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
" vim: foldmethod=marker | |
:set nocompatible "For latest settings/options | |
" execute pathogen#infect() | |
" ####### Load external files ####### {{{1 | |
" Load the vundle plugins file | |
so $HOME\plugins.vim | |
" Load defined support functions | |
so $HOME\partials\functions.vim |
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
filetype off " required | |
set rtp+=$VIM/vimfiles/bundle/Vundle.vim/ | |
call vundle#begin('$VIM/vimfiles/bundle/') | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'tpope/vim-vinegar' | |
Plugin 'scrooloose/nerdtree' | |
Plugin 'itchyny/lightline.vim' | |
Plugin 'vim-syntastic/syntastic' |
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! <SID>StripTrailingWhitespaces() | |
"Get the save last search and cursor position | |
let _s=@/ | |
let l = line('.') | |
let c = col('.') | |
"Strip trailing whitespaces | |
%s/\s\+$//e | |
"Restore prev search history and cursor location | |
let @/=_s | |
call cursor(l, c) |
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
Fira Code | |
Monaco | |
Hack | |
CamingoCode | |
Source Code Pro | |
Consolas | |
Input | |
Inconsolata | |
Cousin | |
PT Mono |
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
@echo off | |
rem http://stackoverflow.com/questions/7005951/batch-file-find-if-substring-is-in-string-not-in-a-file | |
set url=%1 | |
set location=%2 | |
echo %url% | find /I ".git">Nul | |
if errorlevel 1 ( | |
set url=%url%.git |