Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
ryanflorence / static_server.js
Last active June 4, 2025 17:36
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@Mikulas
Mikulas / FormMacros.php
Created October 3, 2010 11:03 — forked from janmarek/FormMacros.php
Form Macros
<?php
namespace Nette\Templating;
use Nette\Forms\Form;
use Nette\Utils\Strings as String;
use Nette\InvalidStateException;
use Nette\Object;
use Nette\Latte\DefaultMacros;
<div id='sidebar'>
<%= section(:sidebar) || partial(:default_sidebar) %>
</div>
@kogakure
kogakure / .gitignore
Last active November 19, 2024 13:22
Git: .gitignore file for LaTeX projects
*.acn
*.acr
*.alg
*.aux
*.bak
*.bbl
*.bcf
*.blg
*.brf
*.bst