I hereby claim:
- I am pjz on github.
- I am pjz (https://keybase.io/pjz) on keybase.
- I have a public key whose fingerprint is 6B5E E345 00C0 73D0 2B56 55C4 1F2F D328 D987 D2AE
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| static char* ICACHE_FLASH_ATTR findUrlPathStart(char *url) { | |
| int i = 7; // skip 'http://' | |
| while (url[i] != '/') { i++; } | |
| return &url[i]; | |
| } | |
| void ICACHE_FLASH_ATTR httpClientFetch(char *url, int retbufsz, void (*cb)(char*)) { | |
| static struct espconn conn; | |
| static ip_addr_t ip; | |
| char *hcserver = url[7]; // skip 'http://' |
| #!./goscript | |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| ) | |
| func main() { | |
| fmt.Println("hello"); |
| import kivy | |
| kivy.require('1.0.9') | |
| from kivy.lang import Builder | |
| from kivy.clock import Clock | |
| from kivy.uix.boxlayout import BoxLayout | |
| from kivy.properties import StringProperty, NumericProperty, ListProperty, ObjectProperty | |
| Builder.load_string(''' | |
| [StringListViewItem@BoxLayout]: |
| #!/usr/bin/gorun | |
| package main | |
| import "os" | |
| import "fmt" | |
| import "strings" | |
| import "go/doc" | |
| import "go/token" | |
| import "go/parser" |
| import base64 | |
| from aspen import Response | |
| def inbound_responder(*args, **kwargs): | |
| """ see BasicAuth object for args; they're passed through """ | |
| auth = BasicAuth(*args, **kwargs) | |
| def _(request): | |
| request.auth = BAWrapper(auth, request) |
| import re | |
| def by_regex(hook, regex_tuples, default=True): | |
| """A filter for hooks. regex_tuples is a list of (regex, filter?) where if the regex matches | |
| the requested URI, then the hook is applied or not based on if filter? is True or False. | |
| """ | |
| regex_res = [ (re.compile(regex), disposition) for regex, disposition in regex_tuples.iteritems() ] | |
| def filtered_hook(request): | |
| for regex, disposition in regex_res: |
| TAGGED_FILES = {} | |
| def tag(filename, taglist): | |
| for tag in taglist: | |
| TAGGED_FILES[tag] = TAGGED_FILES.get(tag, frozenset([])).union(frozenset([filename])) | |
| def by_tag(hook, tag): | |
| """A filter for hooks. tag is the tag that must be present for the file if it's to match. |
| # This will change your prompt and screen/tmux tab title based on how many | |
| # fields there are in the FQDN. For a normal 3 field FQDN, it will use $HOSTNAME | |
| # like normal. For 4+ fields it will set it to field1.field2. | |
| # Rename screen window | |
| function rename_screen_tab () { echo -ne "\x1bk$@\x1b\\"; return 0; } | |
| MYHOST=`echo $HOSTNAME | sed 's/[.][^.]*[.][^.]*$//'` | |
| [[ $TERM == "screen" ]] && PROMPT_COMMAND='rename_screen_tab ${MYHOST}' | |
| PS1="\d \A \w\n\u@$MYHOST > " |
| from subprocess import Popen, PIPE | |
| def cat(*files): | |
| result = [] | |
| for f in files: | |
| result.extend(open(f).readlines()) | |
| return result | |
| def pipe(cmd, text=None,filename=None): |