Skip to content

Instantly share code, notes, and snippets.

@zedshaw
zedshaw / lua_jester_sqlite.nim
Created February 24, 2017 03:20
Quick hack to sort out Lua in Jester with SQL DB in Nim
import db_sqlite
import jester, asyncdispatch, htmlgen
import nimLUA
let db = open("test.sqlite3", nil, nil, nil)
proc render(page: string, name: string) : string =
var L = newNimLua()
discard L.pushstring(name)
L.setglobal("name")
@zedshaw
zedshaw / ex23.py
Last active February 27, 2017 21:01
Potential LPy3THW Exercise 23 to teach Encodings
import sys
languages = [
"Afrikaans", "አማርኛ", "Аҧсшәа", "العربية",
"Aragonés", "Arpetan", "Azərbaycanca", "Bamanankan",
"বাংলা", "Bân-lâm-gú", "Беларуская", "Български",
"Boarisch", "Bosanski", "Буряад", "Català",
"Чӑвашла", "Čeština", "Cymraeg", "Dansk",
"Deutsch", "Eesti", "Ελληνικά", "Español",
"Esperanto", "فارسی", "Français", "Frysk",
if not exist ".\Libraries\" (mkdir ".\Libraries\")
if not exist ".\Libraries\wget.exe" (
if exist ".\wget.exe" (
move ".\wget.exe" ".\Libraries\"
) else (
bitsadmin.exe /reset
bitsadmin.exe /create "Infinity"
bitsadmin.exe /addfile "Infinity" http://pigtronix.com/SPLapplication/PC/Libraries/wget.exe %~dp0Libraries\wget.exe
bitsadmin.exe /resume "Infinity"
echo Waiting for the transfer to complete...