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
" pathogen | |
execute pathogen#infect() | |
syntax on | |
filetype on | |
filetype plugin on | |
filetype indent on | |
" core settings | |
set ruler | |
set tabstop=2 |
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
# alias | |
alias ls='gls --color=always --group-directories-first' | |
alias ll='ls -l' | |
# git prompt | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\.\1/' | |
} | |
export PS1="\[\033[38m\]\u@\h\[\033[01;36m\]:\w\[\033[32m\]\$(parse_git_branch)\[\033[37m\]$\[\033[00m\] " |
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 nomad($text) { | |
$text = htmlentities($text); | |
// strong | |
$text = preg_replace_callback('@\*(.+)\*@U', function ($m) { | |
return '<strong>'.trim($m[1]).'</strong>'; | |
}, $text); |
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 | |
// minimal routing | |
function web_app($routes, $req_verb, $req_path) { | |
$req_verb = strtoupper($req_verb); | |
$req_path = trim(parse_url($req_path, PHP_URL_PATH), '/'); | |
$found = false; | |
if (isset($routes[$req_verb])) { |
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 | |
include './fmt.php'; | |
$text = ''; | |
if (strtolower($_SERVER['REQUEST_METHOD']) === 'post') | |
$text = $_POST['text']; | |
?> | |
<!DOCTYPE html> | |
<html> |
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
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700); | |
/*---------------- | |
* control styles | |
*/ | |
body { | |
color: #333; | |
font-size: 14px; | |
line-height: 19px; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style type="text/css"> | |
.edit { | |
padding-left: 18px; | |
background: #ff6 url(http://www.famfamfam.com/lab/icons/silk/i |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div><span id="host1">mysql-a</span>.protego.com</div> | |
<div><span id="host2">mysql-a</span>.protego.com</div> |
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 previewImage(file) { | |
var reader = new FileReader(); | |
reader.onload = function (e) { | |
var o = $('<img class="img">').attr('src', e.target.result), | |
r = $('.img-box'); | |
o.load(function (e) { | |
r.append(o); | |
var h = o.height(), |
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 b58_to_dec($val) { | |
return gmp_strval(gmp_init((string) $val, 58), 10); | |
} | |
function b58_to_hex($val) { | |
return gmp_strval(gmp_init((string) $val, 58), 16); | |
} | |
function dec_to_b58($val) { |