Skip to content

Instantly share code, notes, and snippets.

@leighhalliday
leighhalliday / config.ru
Created February 17, 2015 16:15
Rack Example
# Use:
# This is in file config.ru
# 1) gem install rack
# 2) rackup
# 3) visit http://localhost:9292 in browser
# 4) Timer info will be in console
# 5) when changing code, will have to restart rackup
# Include rack
require 'rack'
# ~/.irbrc
# Requires the following gems: wirble, hirb
#
# Hirb: http://tagaholic.me/hirb/doc/index.html
# Wirble: http://pablotron.org/software/wirble/
require 'irb/completion'
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
{block headcontent}
{foreach $js as $script}
<script type="text/javascript" src="{$basePath}/js/{$script}"></script>
{/foreach}
{foreach $css as $sheet}
<link rel="stylesheet" media="screen,projection,tv" href="{$basePath}/css/{$sheet}" type="text/css">
{/foreach}
{/block}
{block content}
@vaclavbohac
vaclavbohac / nf.sh
Created May 4, 2010 11:48
Nette skeleton
#!/bin/bash
# Vaclav Bohac (c) 2010
SCAFDIR=$HOME/repo/nette-scaffolding
if [ "$1" = "create" ]; then
shift
if [ ! -n "$1" ]; then
echo "You must specify a project name"
<?php
namespace App\Controls;
class Foo extends \App\Basis\Control
{
}
<?php
require 'Nette/loader.php';
require 'stringFluent.php';
$string = string("ahoj já jsem petr")->capitalize();
echo $string."\n";
echo $string->webalize();
<?php
/**
* Form control for selecting date
*
* Internally holds date as DateTime instance which is also returned by getValue method
*
* @author Jan Tvrdík
*/
class DatePicker extends Nette\Forms\FormControl
{
@vaclavbohac
vaclavbohac / default.phtml
Created July 17, 2010 13:20
AJAX Request from Google Closure Library to Nette Framework back-end
{block content}
<div id="header">
<h1>Integration of Nette Framework and Google Closure Library</h1>
<h2>Two most powerfull frameworks.</h2>
</div>
<div>
{snippet:list}
<?php
/**
* Live Client Script
* support for live validation of Nette/Forms
*
* @version 0.8
* @author David Grudl, Radek Ježdík, Marek Dušek
* @package Nette\Extras\Live-Form-Validation
*
@vaclavbohac
vaclavbohac / Homepage.default.phtml
Created August 10, 2010 12:24
Usage example of Gmaps component
{block content}
<div id="header">
<h1>It works!</h1>
<h2>Congratulations on your first Nette Framework powered page.</h2>
</div>
<div>
<p>{$message}</p>