Skip to content

Instantly share code, notes, and snippets.

View vaclavbohac's full-sized avatar

Vaclav Bohac vaclavbohac

View GitHub Profile
var nette = nette || { };
nette.getValue = function(elem) {
if (!elem) {
var undefined;
return undefined;
}
if (!elem.nodeName) { // radio
for (var i = 0, len = elem.length; i < len; i++) {
{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"
#include <iostream>
#include <math.h>
#include <iomanip>
#include <assert.h>
#include <ctime>
#include <cstdlib>
#include "Matrix.hpp"
using namespace std;
@vaclavbohac
vaclavbohac / index.html
Created May 20, 2010 12:59
Sheep counter with jquery
We couldn’t find that file to show.
@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}
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
#!/bin/bash
# Author: Vaclav Bohac <bohac.v@gmail.com>
#
# Run easily Google Closure compiler in your project directory.
#
# This program 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
# (at your option) any later version.
@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>
#!/bin/bash
# Refresh firefox "externaly" using repl.
echo "BrowserReload();" | nc -q 1 localhost 4242 2>&1 > /dev/null