--- /dev/null
+title = linux bash profile
+date = march 11 2011
+--
+<pre class="prettyprint">
+alias ls='ls --color'
+export CLICOLOR=1
+export LSCOLORS=gxFxCxDxBxgggdabagacad
+
+export EDITOR='emacs'
+</pre>
\ No newline at end of file
--- /dev/null
+date = 2011-02-02
+title = osx bash profile
+--
+
+<pre class="prettyprint" >
+# color ls
+export CLICOLOR=1
+export TERM=xterm-color
+export LSCOLORS=GxFxCxDxBxegedabagacad
+
+
+# minimal prompt
+# export PS1="
+# $PWD
+# : "
+
+
+# current git branch
+export PS1="
+\[\033[38m\]\u@\h\[\033[01;34m\] \w \[\033[31m\]\`ruby -e \"
+print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').
+gsub(/^\* (.+)$/, '(\1) ')\"\`\[\033[37m\]
+$\[\033[00m\] "
+
+
+# aliases
+alias ff="find . -type f -name "
+</pre>
\ No newline at end of file
--- /dev/null
+title = create ssh keys
+date = april 16 2011
+--
+<pre class="prettyprint">
+local~ $ ssh-keygen -t rsa
+// linux
+local~ $ ssh-copy-id [user@]host
+// osx
+local~ $ cat ~/.ssh/id_rsa.pub | ssh user@machine "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
+local~ $ eval `ssh-agent`
+local~ $ ssh-add
+</pre>
\ No newline at end of file
--- /dev/null
+title = Combine Files (Windows)
+date = Wed, april 27 2011
+tags = windows cmd console
+--
+<pre class="prettyprint">
+copy /b file1+ file2 output
+</pre>
+eg
+<pre class="prettyprint">
+copy /b picture.jpg + archive.rar file.jpg
+</pre>
+
+Open file.jpg with the default application, it will show the picture "picture.jpg".
+Change the extension to "file.rar" or if you try to open "file.jpg" with an archiver you will get the contents of "archive.rar".
+
body { margin:20px 100px 50px 30px; }
-html, body, table { font-family: sans-serif; font-size:14px; line-height:1.4em; color:#44d ; }
+html, body, table {
+ font-family: serif;
+ font-size:16px;
+ line-height:1.4em;
+ color:#44d;
+}
+
-::-moz-selection {background: #08f !important; color:#fff;}
-::selection {background: #08f !important; color:#fff;}
+::-moz-selection {background: #08f !important; color:#fff;}
+::selection {background: #08f !important; color:#fff;}
a { color:#000; border:0; padding:0.2em 0.1em 0 0; }
a img { border:0; }
a.mute { text-decoration:none !important; font-weight:normal;}
a:hover, a.mute:hover { color:#d15; text-decoration:none; }
-h1, h2, h3, h4, h5, h6 { font-size:1em; }
+h1, h2, h3, h4, h5, h6 { font-family:'Droid Serif'; font-size:1em; }
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { }
h1 { margin:0 0 3em 0; }
h2 { margin:0 0 0.5em 0; }
h3 { margin:0 0 0 0; }
+h4 { margin-top:0; }
ul, li { margin:0; padding:0; list-style-type:none; }
ol { margin:0;}
blockquote { font-family:times; background:#000; color:#aaa;
margin:0; font-size:15px; line-height:1.4em; padding:2em 4em; font-style:italic; line-height:1.45em; max-width:600px;}
-#content { padding-right:160px; min-width:500px; padding-bottom:200px; z-index:10; }
+#content { padding-left:160px; min-width:500px; padding-bottom:200px; z-index:10; }
#content p:first-child { margin-top:0; }
p { max-width:720px; }
-.nav { position:absolute; width:200px; z-index:1; top:20px; right:20px; margin:0; }
-.nav a { text-decoration:none; font-weight:bold; }
+.nav { position:fixed; top:20px; left:20px; }
+.nav a { text-decoration:none; font-weight:bold; }
.nav a.mute { font-weight:normal; }
.nav h1 { }
.index { padding:0; margin:0; }
.index li {line-height:1.1em; margin-bottom:0.4em; }
-.index li a { text-decoration:underline; font-weight:normal; }
+.index li a { text-decoration:underline; font-weight:normal; }
.entry { margin-bottom:100px; }
.entry h2 { padding-bottom:4px; font-size:1.3em;}
.entry .metadata a { color:#999; }
.entry .metadata a:hover { color: #000;}
.entry .metadata .tags li { display:inline-block; margin-right:0.3em; }
-
+
.more, .home { text-decoration:none; color:#000; font-weight:bold; }
table { margin:0; padding:0; border:0; }
.bookmark_links li span { font-style: italic; color:#444; }
.image li a { background:none; }
-#footer { margin-top:120px; }
+#footer { margin-top:120px; }
#footer .copy a { text-decoration:none; }
a.rss {
}
a.external {
background:url("/img/external-icon.png") no-repeat scroll right center transparent;
- padding:0 1.3em 0 0;
+ padding:0 1.3em 0 0;
}
\ No newline at end of file
require_once 'lib/init.php';
$url = get_url();
-
list($response_format, $response_mime_type) = parse_format($url['extension'], 'html');
# setup template
$t = get_template_instance();
$t->response_format = $response_format;
- $t->assign('view', $_GET['v']);
+ $t->assign('view', isset($_GET['v']) ? $_GET['v'] : null);
$content_request = LOCAL_ROOT . CONTENT_DIR . $url['dirname'] . '/' . $url['filename'];
$page_request = LOCAL_ROOT . PAGE_DIR . DIRECTORY_SEPARATOR . $url['filename'];
+ $total = 0;
# content exists, and is a folder
- if (is_dir($content_request)) {
+
+ if ($url['filename'] == '')
+ {
+ $page = parse_entry(new SplFileInfo('/home/quilime/quilime.com/pages/about'), 1);
+ $t->assign('data', $page);
+ $template = $page['config']['template'] ? $page['config']['template'] . '.' . $response_format . '.tpl' : 'page.' . $response_format . '.tpl';
+ // $template = 'index.html.tpl';
+ }
+ else if (is_dir($content_request)) {
# get config in folder, if exists
if (is_file($content_request . '/' . CONFIG_FILE )) {
$config = parse_entry(new SplFileInfo($content_request . '/' . CONFIG_FILE));
$t->assign('data', $data);
$t->assign('page_title', preg_replace('{^/|/$}', '', $url['url']));
}
-
+
# content exists, and is a single entry
else if (is_file($content_request)) {
$t->assign('data', parse_entry(new SplFileInfo($content_request)));
$t->assign('single', true);
$template = 'single.'.$response_format.'.tpl';
}
-
+
# content exists, and is a page
else if (is_file($page_request)) {
$page = parse_entry(new SplFileInfo($page_request), 1);
$t->assign('data', $page);
$template = $page['config']['template'] ? $page['config']['template'] . '.' . $response_format . '.tpl' : 'page.' . $response_format . '.tpl';
}
-
+
# 404
else {
$template = '404.html.tpl';
.str { color: #f26; }
.kwd { color: #99f; font-weight:bold; }
.com { color: #888; font-style:italic; }
-.typ { color: #f0f; }
+.typ { color: #93d44f; }
.lit { color: #099; }
.pun { color: #66d; }
.pln { color: #ffd; }
.atv { color: #080; }
.dec { color: #606; }
pre.prettyprint, code.prettyprint {
- font-family:monaco, "Lucida Console", monospace; font-size:14px; line-height:1.5em; padding:0.4em 0.6em; background:#222333;
+
+ font-family:monaco, "Lucida Console", monospace; font-size:14px; line-height:1.5em; padding:0.4em 0.6em; background:#111111
+;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
- border:2px solid #666;
- border-bottom-color:#bbb;
- border-right-color:#bbb;
}
pre.prettyprint { padding:20px; }
.tag { color: #006; font-weight: bold; }
.atn { color: #404; }
.atv { color: #060; }
-}
+}
\ No newline at end of file
if ($recursive) {
$iterator = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_PATHNAME);
$dir_iterator = new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::SELF_FIRST);
- }
+ }
else {
$dir_iterator = new DirectoryIterator($path);
}
-
+
$entries = array();
foreach ($dir_iterator as $file => $info) {
if (!$info->isDir() && $info->getFilename() != CONFIG_FILE) {
$entries[] = parse_entry($info);
}
}
-
+
switch ($order_by)
{
default :
foreach ($entries as $key => $row)
- $time[$key] = $row['timestamp'];
+ $time[$key] = $row['timestamp'];
if ($time)
- array_multisort($time, $order, $entries);
+ array_multisort($time, $order, $entries);
}
-
+
return array($entries, sizeof($entries));
}
*/
function get_dirs( $path = "", $args = array())
{
- $recursive = isset($args['recursive']) ? $args['recursive'] : 1;
+ $recursive = isset($args['recursive']) ? $args['recursive'] : 1;
$path = LOCAL_ROOT . CONTENT_DIR . $path;
if ($recursive) {
$iterator = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_PATHNAME);
$dir_iterator = new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::SELF_FIRST);
- }
+ }
else {
$dir_iterator = new DirectoryIterator($path);
}
$dirs[] = $d;
}
}
- return $dirs;
+ return $dirs;
}
$config = "";
$content = "";
$content_short = "";
+ $passed_more = false;
$passed_config = false;
$file_contents = file($fileInfo->getRealPath(), FILE_USE_INCLUDE_PATH);
foreach ( $file_contents as $line ) {
$file = array();
$file['config'] = parse_ini_string($config);
$file['title'] = $file['config']['title'];
+ $file['config']['date'] = isset($file['config']['date']) ? $file['config']['date'] : null;
$file['timestamp'] = $file['config']['date'] ? date('U', strtotime( $file['config']['date'])) : $fileInfo->getCTime();
- $file['tags'] = $file['config']['tags'] ? explode(" ", $file['config']['tags']) : null;
+ $file['tags'] = isset($file['config']['tags']) ? explode(" ", $file['config']['tags']) : null;
$file['content'] = Markdown($content);
if ($passed_more)
$file['content_short'] = Markdown($content_short);
-<?php
+<?php
putenv("TZ=America/Los_Angeles");
-
+
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . dirname(realpath(__FILE__)));
define ('SITE_TITLE', 'quilime');
define ('LOCAL_ROOT', '/home/quilime/quilime.com/');
define ('WEB_ROOT', 'http://quilime.com/');
-
+
define ('CONTENT_DIR', 'content');
define ('TEMPLATE_DIR', 'templates');
- define ('PAGE_DIR', 'pages');
- define ('CONFIG_DELIMITER', '--');
+ define ('PAGE_DIR', 'pages');
+ define ('CONFIG_DELIMITER', '--');
define ('MORE_DELIM', '<!--more-->');
define ('TITLE_DELIMITER', ': ');
- define ('CONFIG_FILE', 'config');
-
+ define ('CONFIG_FILE', 'config');
+
require_once 'data.php';
require_once 'output.php';
- require_once 'markdown.php';
- require_once 'template.php';
+ require_once 'markdown.php';
+ require_once 'template.php';
+
+
+ //error_reporting(E_ALL);
+ //ini_set("display_errors", 1);
?>
\ No newline at end of file
$t = new Template();
$t->template_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', TEMPLATE_DIR));
$t->template_cache_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', TEMPLATE_DIR, 'cache'));
-
+
return $t;
}
/**
- * @param format
+ * @param format
* @param default format
*/
function parse_format($format, $default)
*/
function clean_slashes($path)
{
- return preg_replace('/\/+/', '/', $path);
+ return preg_replace('/\/+/', '/', $path);
}
return round(abs($seconds) / (24 * 60 * 60)).' days';
}
}
-
+
/**
* @param int $time Unix timestamp
function get_rss_feed( $url )
{
+ /*
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$feed = curl_exec($ch);
curl_close($ch);
-
+
$xml = new SimpleXMLElement($feed);
- return $xml;
+ return $xml;
+ */
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
+ curl_setopt($ch, CURLOPT_TIMEOUT, 5);
+ curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
+ $data = curl_exec($ch);
+ curl_close($ch);
+ return new SimpleXMLElement($data);
}
{
header("HTTP/1.1 {$code}");
die($message);
-}
+}
function get_base_dir()
function get_url_parts()
-{
- $parts = explode('/', substr($_SERVER['SCRIPT_URL'], strlen(get_base_dir() . '/')));
+{
+ $parts = explode('/', substr($_SERVER['SCRIPT_URL'], strlen(get_base_dir() . '/')));
return $parts[0] ? $parts : 0;
}
function get_url()
{
$path_info = pathinfo($_SERVER['SCRIPT_URL']);
- $path_info['url'] = preg_match("/\.\.\//", $_SERVER['SCRIPT_URL']) ? '/' : $_SERVER['SCRIPT_URL'];
+ $path_info['url'] = preg_match("/\.\.\//", $_SERVER['SCRIPT_URL']) ? '/' : $_SERVER['SCRIPT_URL'];
+ $path_info['extension'] = null;
return $path_info; //substr($_SERVER['SCRIPT_URL'], strlen(get_base_dir() . '/'));
}
title = about
--
-quilime.com is a codification of creative process and resources
-by **gabriel dunne** ([www](http://gabrieldunne.com), [email](mailto:gdunne@quilime.com))
-elsewhere:
-[flickr](http://flickr.com/photos/quilime/),
-[vimeo](http://vimeo.com/quilime/),
+quilime is a codification of creative process and resources
+by **gabriel dunne** ([www](http://gabrieldunne.com), [email](mailto:gdunne@quilime.com))
+<br />elsewhere:
+[github](http://github.com/quilime/),
+[vimeo](http://vimeo.com/quilime/),
+[clmpr](http://clmpr.com/quilime/),
+[flickr](http://flickr.com/photos/quilime/),
[delicious](http://delicious.com/quilime/),
-[twitter](http://twitter.com/quilime/),
-[github](http://github.com/quilime/)
+[ffffound](http://ffffound.com/home/quilime/found/),
+[twitter](http://twitter.com/quilime/)
+
+
+site source code: <a href="http://git.quilime.com/?p=plog.git;a=summary">plog</a>
site update <a href="http://quilime.com/.rss" class="rss">rss</a>
+
<? foreach($data as $entry): ?>
<?
if ($entry['content_short'])
- $entry['content'] = $entry['content_short'] . '<br /><a class="more" href="'.$entry['url'].'">more →</a><br /><br />';
- $this->include_template('entry.html.tpl', array('data' => $entry));
+ $entry['content'] = $entry['content_short'] . '<br /><a class="more" href="'.$entry['url'].'">more →</a><br /><br />';
+
+
+ $this->include_template('entry.html.tpl', array('data' => $entry));
+
+
?>
<? endforeach; ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?= get_base_dir(); ?>/.rss" />
+
+
+<link href="http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic&subset=latin" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=Droid+Sans+Mono:regular,italic&subset=latin" rel="stylesheet" type="text/css">
+<link href='http://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'>
+
<link rel="stylesheet" href="<?= get_base_dir(); ?>/css/style.css" type="text/css">
-<link href="<?= get_base_dir(); ?>/js/prettify/prettify.css" type="text/css" rel="stylesheet" />
- <script type="text/javascript" src="<?= get_base_dir(); ?>/js/jquery-1.3.2.min.js"></script>
-<script type="text/javascript" src="<?= get_base_dir(); ?>/js/prettify/prettify.js"></script>
-
+<link href="<?= get_base_dir(); ?>/js/prettify/prettify.css" type="text/css" rel="stylesheet" />
+<script type="text/javascript" src="<?= get_base_dir(); ?>/js/jquery-1.3.2.min.js"></script>
+<script type="text/javascript" src="<?= get_base_dir(); ?>/js/prettify/prettify.js"></script>
<script>
$(document).ready(function() {
prettyPrint();
});
-</script>
+</script>
<script type="text/javascript">
<html>
<head>
-
+
<? $this->include_template('head-inc.html.tpl') ?>
-
- <title><?=SITE_TITLE?></title>
- <meta http-equiv="refresh" content="0;url=/log/">
+ <title><?=SITE_TITLE?></title>
</head>
<body>
-
+
<? $this->include_template('nav.html.tpl') ?>
-
+
<div id="content">
-<br />
-<br />
-<br />
-<br />
-<br />
-← navigation
-
+this website is a codification of creative process, resources, and inspiration <br/>by gabriel dunne (<a href="http://gabrieldunne.com">www</a>, <a href="mailto:gdunne@quilime.com">email</a>)
+
</div>
<? $this->include_template('footer.html.tpl') ?>
-<ul class="nav">
+<ul class="nav">
- <li><a href="/"><?=SITE_TITLE?></a></li>
- <li>by gabriel dunne</li>
- <li><br /></li>
+ <li><a href="/">home</a></li>
- <li><h3>contents</h3></li>
<? $dirs = get_dirs("", array('recursive' => 0)); ?>
<? foreach($dirs as $dir) : ?>
<li><a href="<?=$dir['url']?>"><?=$dir['name']?></a></li>
<li><a href="/photo/">photo</a></li>
<li><a href="/agg/">aggregate</a></li>
- <li><a href="/links/">links</a></li>
- <li><a href="/about/">about</a></li>
+ <li><a href="/links/">links</a></li>
+
+
<br />
</ul>
*/ ?>
-</ul>
+</ul>