Skip to content

Instantly share code, notes, and snippets.

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...
@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",
@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")
import os
import csv
import sys
data = {}
completed = []
base_url = "https://www.amazon.com/gp/your-account/order-history/ref=oh_aui_search?opt=ab&search=%s"
def amzn_url(order_id):
return base_url % order_id
import os
import csv
import sys
data = {}
completed = []
base_url = "https://www.amazon.com/gp/your-account/order-history/ref=oh_aui_search?opt=ab&search=%s"
def amzn_url(order_id):
return base_url % order_id
import os
import csv
import sys
data = {}
completed = []
base_url = "https://www.amazon.com/gp/your-account/order-history/ref=oh_aui_search?opt=ab&search=%s"
def amzn_url(order_id):
return base_url % order_id
@zedshaw
zedshaw / gist:4e14bbca46eb21aad08d
Created June 18, 2015 04:44
If you ever need to build apache APR on OSX Yosemite, just touch it a whole bunch.
set -e
# go somewhere safe
cd /tmp
# get the source to base APR 1.5.2
curl -L -O http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
# extract it and go into the source
tar -xzvf apr-1.5.2.tar.gz
@zedshaw
zedshaw / safercopy_smash.c
Created January 4, 2015 19:07
Demonstration of using a pointer to alter the operation of another function in C.
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#define MAXLINE 10 // in the book this is 1000
void safercopy(size_t to_length, char to[], size_t from_length, char from[])
{
int i = 0;
@zedshaw
zedshaw / safercopy.c
Created January 4, 2015 17:18
A simple version of copying via string lengths then breaking it on purpose
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#define MAXLINE 10 // in the book this is 1000
void safercopy(size_t to_length, char to[], size_t from_length, char from[])
{
int i = 0;
blah blah