A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
- Headers
- Links
- Bold
- Emphasis
- Deletions
<?php | |
session_start(); | |
if (empty($_SESSION['path'])) { | |
$_SESSION['user'] = shell_exec('whoami'); | |
$_SESSION['host'] = shell_exec('hostname'); | |
$_SESSION['path'] = '~'; | |
} |
<?php | |
/* | |
* class.couchdb.php - A class for easy use of CouchDB databases in PHP | |
* | |
* Copyright (C) 2012 Patrick "p2k" Schneider <patrick.p2k.schneider@gmail.com> | |
* | |
* This is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or |
<?php | |
use \Nette\Utils\Json; | |
/** | |
* Minimalistic Google OAuth2 connector | |
* @author Mikuláš Dítě | |
*/ | |
class Google extends Nette\Object | |
{ |
<?php | |
class RESTRequest | |
{ | |
public $response; | |
public $code; | |
private $handle; | |
private $session; | |
private $curlopts; |
<?php | |
/** | |
* WaveFileReader; a simple class to read/parse WAVE file | |
* (c)2012 Rob Janssen / https://github.com/RobThree | |
* | |
* Based on https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ | |
* | |
* USAGE: | |
* | |
* $wav = WaveFileReader::ReadFile('/path/to/test.wav'); |
<!doctype html> | |
<meta charset="utf-8"> | |
<title>Using Showdown with and without jQuery: demo</title> | |
<style> | |
textarea, #preview { width: 500px; height: 150px; margin-bottom: 1em; padding: .5em 1em; overflow-y:auto} | |
#preview { border: 1px solid #666; } | |
</style> | |
<link rel="first" href="http://mathiasbynens.be/notes/showdown-javascript-jquery" title="Using Showdown with and without jQuery"> | |
<link rel="prefetch" href="http://mathiasbynens.be/notes/showdown-javascript-jquery" title="Using Showdown with and without jQuery"> | |
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/default.min.css"> |
function randomColor($id){ | |
$rawR = mt_rand(0, 10) * 25.5; | |
$rawG = mt_rand(0, 10) * 25.5; | |
$rawB = mt_rand(0, 10) * 25.5; | |
$mix = ceil(($id % 5) / 5 * 255); | |
$r = ceil(($rawR + $mix) % 255); | |
$g = ceil(($rawG + $mix) % 255); | |
$b = ceil(($rawB + $mix) % 255); | |
return str_pad(dechex(($r << 16) | ($g << 8) | $b), 6, '0', STR_PAD_LEFT); |
( function ( window, undefined ) { | |
var Aloha = window.Aloha || ( window.Aloha = {} ); | |
Aloha.settings = { | |
logLevels: { 'error': true, 'warn': true, 'info': true, 'debug': false, 'deprecated': true }, | |
errorhandling: false, | |
ribbon: false, | |
locale: 'en', | |
floatingmenu: { | |
width: 630, |
<?php | |
/** | |
* This function computes a hash of an integer. This can be used to not expose values to a customer, such as | |
* not giving them the id value for passing them to URLs. This algorithm is a bidirectional encryption (Feistel cipher) that maps | |
* the integer space onto itself. | |
* | |
* @link http://wiki.postgresql.org/wiki/Pseudo_encrypt Algorithm used | |
* @link http://en.wikipedia.org/wiki/Feistel_cipher Wikipedia page about Feistel ciphers | |
* @param int $value | |
* @return int |