This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import sys.io.Process; | |
/** | |
* Created by Alex Koz. | |
* Date: 20.12.13 | |
*/ | |
// TerribleClassNameLOL | |
class GetPID_example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import subprocess | |
__all__ = ["transform"] | |
__version__ = '0.3' | |
__author__ = 'Christoph Burgmer <[email protected]>' | |
__url__ = 'http://github.com/cburgmer/upsidedown' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Talk with /System/Library/CoreServices/WiFiAgent.app/Contents/MacOS/WiFiAgent | |
-- For example for my wifi-hotspot named "Wi-Fi": | |
set myWiFiName to "Wi-Fi. Secure network." | |
-- Format: "{name}." | |
-- or if your wifi is closed: "{name}. Secure network." - ( optional variant ) | |
tell application "WiFiAgent" | |
--activate | |
tell application "System Events" | |
tell process "Wi-Fi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.unit.TestRunner; | |
import haxe.unit.TestCase; | |
import haxe.Constraints.Function; | |
import haxe.macro.Printer; | |
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
OlderNewer