Skip to content

Instantly share code, notes, and snippets.

View pce's full-sized avatar

Patrick C. Engel pce

  • UTC++
View GitHub Profile
@pce
pce / asciimap-gen.php
Created December 11, 2011 13:52
ascii map text-format generator, asserts a test when invoked from cli
<?php
function ascii_lexan($s)
{
$tokens = array();
$strlen = strlen($s);
for ($i = 0;$i < $strlen; $i++) {
$tokens []= ord($s[$i]);
}
return $tokens;
@pce
pce / asciimap.html
Created December 11, 2011 13:31
ascii map text-format
<script>
function asciimap_decode (s) {
var out = '';
var _r = [];
var count, ascii = 0;
var blocks = s.split('|');
// console.log(blocks);
for (var block in blocks) {
// console.log(blocks[block]);
_r = blocks[block].split(':');
@pce
pce / monitor_changes_dir.php
Created March 1, 2011 00:23
monitor_changes_dir
#!/usr/bin/env php
<?php
/**
* monitor_changes_dir.php is a simple Command Line Script
* which monitor changes of a directory and calls a `on_file_change' function.
* Make sure it is executable.
*
* `on_file_change' calls sftp_upload,
*
@pce
pce / .zshrc
Created January 23, 2011 11:04
cat ~/.zshrc
# PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m%{$fg[yellow]%}%~%{$reset_color%}%%"
local blue_op="%{$fg[blue]%}[%{$reset_color%}"
local blue_cp="%{$fg[blue]%}]%{$reset_color%}"
local path_p="${blue_op}%~${blue_cp}"
local user_host="${blue_op}%n@%m${blue_cp}"
local ret_status="${blue_op}%?${blue_cp}"
local hist_no="${blue_op}%h${blue_cp}"
local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color%})"
PROMPT="╭─${path_p}─${user_host}