Skip to content

Instantly share code, notes, and snippets.

View luopio's full-sized avatar

Lauri Kainulainen luopio

View GitHub Profile
@luopio
luopio / webhooker.py
Last active January 15, 2024 04:37
Listen for incoming webhooks and other requests to run shell commands. No external dependencies other than python
#!/usr/bin/python3 -u
#coding=utf-8
"""
Listens for incoming requests on given port (default 8080). Acts on POST requests
by looking for a matching path in the config file (default webhooker.config).
Example config:
deploy_my_cool_project: /home/dude/deploy_the_stuff.sh
@luopio
luopio / gist:f5a58f1dacf94d6094ad
Last active June 17, 2016 15:54 — forked from gnepud/gist:5804215
Generating a Paymill token to test without the Javascript Bridge
module PaymillSupport
def get_payment_token
# Simulate the JavaScript bridge we would use in production
params = {
'transaction.mode' => 'CONNECTOR_TEST',
'channel.id' => Rails.configuration.paymill_public_key,
'jsonPFunction' => 'function',
'account.number' => '4111111111111111',
'account.expiry.month' => 1.year.from_now.month,