-
Create a one-off Heroku app (or use an existing one) for the compilation.
-
Set the app to use the Python buildpack with OpenSSL 1.0.2g
heroku buildpacks:set https://github.com/yuvadm/heroku-buildpack-python-openssl-1.0.2.git -a myapp
-
Run a one-off dyno to do the compilation:
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 boto3 | |
import click | |
@click.command() | |
@click.argument("bucket") | |
@click.argument("key") | |
@click.option("-e", "--expiration", default=3600, type=int, help="How long this presigned URL will live for") | |
def presign_s3(bucket, key, expiration): | |
""" Simple utility to generate presigned URL on S3 (Default 1 hour expiration) |
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 boto3 | |
def role_arn_to_session(**args): | |
""" | |
Usage : | |
session = role_arn_to_session( | |
RoleArn='arn:aws:iam::012345678901:role/example-role', | |
RoleSessionName='ExampleSessionName') | |
client = session.client('sqs') | |
""" |
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
$ python3 -i shellasync.py | |
>>> import websockets | |
>>> websockets.connect("ws://localhost:8000/echo") | |
<websockets.client.WebSocketClientProtocol object at 0x1041a34e0> | |
>>> ws = _ # only caveat is assignment has to be done after | |
>>> ws.send("Hello world") | |
None | |
>>> ws.recv() | |
'Hello world' | |
>>> |
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
---------- RAW ---------- | |
JSON 34291 byte(s) | |
MsgPack 26364 byte(s) | |
---------- GZIP --------- | |
JSON 05986 byte(s) | |
MsgPack 06198 byte(s) | |
---------- LZ4 ---------- | |
JSON 09758 byte(s) | |
MsgPack 08548 byte(s) |
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 | |
# -*- coding: utf-8 -*- | |
# Localize.py - Incremental localization on XCode projects | |
# João Moreno 2009 | |
# http://joaomoreno.com/ | |
# Modified by Steve Streeting 2010 http://www.stevestreeting.com | |
# Changes | |
# - Use .strings files encoded as UTF-8 |
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
func debounce( delay:NSTimeInterval, #queue:dispatch_queue_t, action: (()->()) ) -> ()->() { | |
var lastFireTime:dispatch_time_t = 0 | |
let dispatchDelay = Int64(delay * Double(NSEC_PER_SEC)) | |
return { | |
lastFireTime = dispatch_time(DISPATCH_TIME_NOW,0) | |
dispatch_after( | |
dispatch_time( | |
DISPATCH_TIME_NOW, |
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
# send message to your devices via pushover.net API | |
# add next two or three lines to .bashrc/.zshrc to use this script | |
# export PUSHOVER_APP="your pushover.net app token" | |
# export PUSHOVER_USER="your pushover.net user key" | |
# # optional: | |
# export PUSHOVER_DEVICE="default device" | |
# USAGE: push <message> [-d=<device>] | |
# OPTIONS: |
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
# send yo to your devices via Yo API | |
# add next line to .bashrc/.zshrc to use this script | |
# export YO_APP="your justyo.co app token" | |
# USAGE: yop [link] | |
__yop(){ | |
local link=$1 | |
local api_url="http://api.justyo.co/yoall/" |
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
# Copyright (c) 2014 Andrey Vlasovskikh | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
NewerOlder