Skip to content

Instantly share code, notes, and snippets.

@jwage
jwage / SplClassLoader.php
Last active April 9, 2024 21:04
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# ~/.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();
@karmi
karmi / post-receive-deploy.rb
Created June 17, 2010 13:21
Example script to deploy a Rails application via Git post-receive hook
#!/usr/bin/env ruby
# Example script to deploy a Rails application via Git post-receive hook
#
# INSTALL
#
# $ curl http://gist.github.com/442106.txt -o post-receive
# $ mv post-receive path/to/to/your/repo.git/hooks/post-receive
# $ chmod +x post-receive
<?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
{
# In your test_helper.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
@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}