Skip to content

Instantly share code, notes, and snippets.

View temnoregg's full-sized avatar

Petr Chalupny temnoregg

View GitHub Profile
<a href="http://okdaz">text linku</a>
@temnoregg
temnoregg / static.js
Created September 18, 2014 12:00
Serving current directory with node-static
var static = require('node-static');
//
// Create a node-static server to serve the current directory
//
var file = new static.Server('.', { cache: false, headers: {"Cache-Control": "no-cache, must-revalidate"} });
require('http').createServer(function (request, response) {
file.serve(request, response, function (err, res) {
if (err && (err.status === 404)) { // An error as occured
# -*- coding: utf8 -*-
"""
MAKESTRINGS – EASIER I18N FOR TITANIUM APPS
Auto-generates localized strings.xml for Appcelerator Titanium projects by inspecting
the project's JS files looking for L() calls.
The scripts adds unlocalized strings to strings.xml, ready for translation. Already
localized strings in strings.xml are not touched.
@temnoregg
temnoregg / moderator.py
Created January 11, 2012 12:44
Django spam filter moderator with StopForumSpam service check
import urllib, urllib2
import xml.dom import minidom
from django.contrib.comments.moderation import CommentModerator
SFS_API_URL = 'http://www.stopforumspam.com/api?'
def is_spam(ip, email):
"""