Skip to content

Instantly share code, notes, and snippets.

View mensly's full-sized avatar

Michael Ensly mensly

View GitHub Profile
@mensly
mensly / deeplink.py
Created September 15, 2023 02:33
Simplified Deeplink Testing
@mensly
mensly / smv.fish
Created January 6, 2022 09:54
Secure Move
function smv --description "smv <localfile> <user>@<host>:<remotefile>"
# What deranged mind needed this?
scp $argv[1..-1]
if [ $argv[1] = '-r' ]
rm $argv[1..2]
else
rm $argv[1]
end
# TODO: Support -r parameter properly
end
⋊> ~/.c/f/functions pwd
/Users/mensly/.config/fish/functions
⋊> ~/.c/f/functions cat focus.fish
function focus
cd ~/Projects/mensly/katzrdum
clear
end
⋊> ~/.c/f/functions cat github.fish
function github
~/Applications/github $argv
@mensly
mensly / AzureRestApiService.kt
Last active February 8, 2017 05:17
Code snippet for setting up an Azure Notification Hub installation (*not* registration) in Kotlin using Retrofit
interface RestApiService {
companion object {
const val PUSH_PLATFORM = "gcm"
}
@PUT
fun installPush(@Url endpoint: String,
@Header("Authorization") authorization: String,
@Body request: PushInstallationRequest): Observable<ResponseBody>
@mensly
mensly / gist:6291843
Last active December 21, 2015 10:28
php-style argument parse thing
import re
def phpdict(src):
myDict = {}
for k, v in src.items():
pattern = re.search('([^[]+)((?:\[[^\]]*\])+)', k)
if pattern:
path = [(int(p) if p.isdigit() else p) for p in re.findall('\[([^\]]+)\]', k)]
new_key = pattern.group(1)