Skip to content

Instantly share code, notes, and snippets.

View boozook's full-sized avatar
🦀
Dreaming about decentralised GH based on Pijul. 👨🏻‍💻

Alexander Koz. boozook

🦀
Dreaming about decentralised GH based on Pijul. 👨🏻‍💻
View GitHub Profile
# Source: https://gist.github.com/4145515
#
# All-purpose gist tool for Pythonista.
#
# When run directly, this script sets up four other scripts that call various
# functions within this file. Each of these sub-scripts are meant for use as
# action menu items. They are:
#
# Set Gist ID.py - Set the gist id that the current file should be
# associated with.
on handle_string(str)
set arrayWithDate to my theSplit(str, "@")
if arrayWithDate's length > 1 then
set theDate to my parseDate(getArrayValue(arrayWithDate, 2))
end if
set arrayWithBody to my theSplit(getArrayValue(arrayWithDate, 1), "#")
if arrayWithBody's length > 1 then
set reminderBody to my getArrayValue(arrayWithBody, 2)
else
#!/usr/bin/env python
import sys, paramiko
if len(sys.argv) < 5:
print "args missing"
sys.exit(1)
hostname = sys.argv[1]
password = sys.argv[2]
@boozook
boozook / evills
Created April 2, 2014 00:37 — forked from Eugeny/evills
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
__all__ = ["transform"]
__version__ = '0.3'
__author__ = 'Christoph Burgmer <[email protected]>'
__url__ = 'http://github.com/cburgmer/upsidedown'
@boozook
boozook / pipista.py
Last active August 29, 2015 14:06 — forked from mlgill/pipista.py
import os, os.path, sys, urllib2, requests, gzip, tarfile
class PyPiError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def _chunk_report(bytes_so_far, chunk_size, total_size):
if (total_size != None):
@boozook
boozook / Tools.hx
Last active August 29, 2015 14:18 — forked from nadako/Main.hx
Enum fast extract
class Tools {
public static macro function extract(value:haxe.macro.Expr.ExprOf<EnumValue>, pattern:haxe.macro.Expr) {
return switch (pattern) {
case macro $a => $b:
macro switch ($value) {
case $a:
$b;
default:
throw "no match";
}
@boozook
boozook / Main.hx
Last active August 29, 2015 14:21 — forked from savage69kr/Main.hx
class Main {
static function parseProperties(text:String):Map<String, String> {
var map:Map<String, String> = new Map(),
ofs:Int = 0,
len:Int = text.length,
i:Int, j:Int,
endl:Int;
while (ofs < len) {
// find line end offset:
endl = text.indexOf("\n", ofs);
@boozook
boozook / ResourceManager.hx
Last active August 26, 2015 19:26 — forked from tiagolr/ResourceManager.hx
Embeding files load with Haxe + Openfl
import haxe.io.Bytes;
import haxe.Resource;
import openfl.Assets;
import openfl.display.Bitmap;
import openfl.display.BitmapData;
import openfl.display.Loader;
import openfl.utils.ByteArray;
/**
@boozook
boozook / Direction.hx
Last active June 8, 2016 14:35 — forked from MSGhero/Direction.hx
Compass direction <=> degree measure abstract for Haxe. Useful for me, maybe for you.
package entities;
import nape.geom.Vec2;
/**
* @author MSGHero
*/
@:enum
abstract Direction(Int) {
@boozook
boozook / Main.hx
Last active November 17, 2015 19:59 — forked from nadako/Main.hx
Signal builder using new Rest type parameter in Haxe
package hx.event.test;
import haxe.unit.TestRunner;
class Main
{
public static function main()
{
var runner = new TestRunner();
runner.add(new SignalTest());