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
wget -O base58.py https://raw.githubusercontent.com/keis/base58/master/base58/__init__.py | |
sed "s~123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ \$%*+-./:~" base58.py > base45.py | |
python3 -c 'import base45; print(base45.b58encode("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
require 'nokogiri' | |
require 'zip' | |
if ARGV.length != 1 | |
puts "Usage: ruby #{File.basename(__FILE__)} ABN-CAMT053.zip" | |
exit | |
end | |
xml_files_content = Zip::ZipFile.open(ARGV.first) do |zip| | |
zip.map do |entry| |
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
# This method worked in March 2019. Please let me know if it fails to work for you | |
# | |
# 1. Go to: https://glitch.com/edit | |
# 2. In the lower left corner of the page, click on Tools -> Console | |
# 3. Paste the following command, and press enter: | |
# curl -sS https://gist.githubusercontent.com/confiks/4a65e03b4e2e8b073002b531335e8cd8/raw/glitch-howto.sh | bash | |
set -x | |
mkdir -p /app/bin |
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
2.3.1 :001 > def foo; end | |
=> :foo | |
2.3.1 :002 > def bar1(*args, **options); foo(*args, **options); end | |
=> :bar1 | |
2.3.1 :003 > def bar2(*args, **options); args == [] && options == {}; end | |
=> :bar2 | |
2.3.1 :004 > def bar3; foo(*[], **{}); end | |
=> :bar3 | |
2.3.1 :005 > bar1 | |
ArgumentError: wrong number of arguments (given 1, expected 0) |
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
require 'faraday' | |
# require 'byebug' | |
class DownloadTweedeKamer | |
def initialize | |
@scheme = "http://" | |
@domain = "tweedekamerlive.download.kpnstreaming.nl" | |
@path = "/plenairezaal/4500" | |
@conn = Faraday.new( |
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
# Not extensively tested | |
# Put this script in the action_plugins directory of your playbook directory | |
# If you have issues, please report it in the comments (or fork and fix) | |
# Usage: | |
# - name: "Ask the user if we should continue." | |
# action: ask_key prompt="Continue? Yes / No / Random (y/n/r)?" accepted_keys="['y', 'n', 'r']" | |
# register: answer | |
# | |
# The pressed key is now in answer.key |
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
// App.js | |
// Route definition and lookup creation | |
let routes = ( | |
<Route path="/" name="root" component={ .. }> | |
<Route name="customer" path="klant" component={ .. } /> | |
.. | |
</Route> | |
); | |
let createRouteLookupByName = (route, prefix = route.props.path) => { |
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
export default function httpClientMiddleware(clientImpl = window.fetch) { | |
return (store) => { | |
return (next) => (action) => { | |
const { httpClient, types, ...rest } = action; | |
if (!httpClient) | |
return next(action); | |
const [REQUEST, SUCCESS, FAILURE] = types; | |
httpClient(clientImpl).then( |
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
// This is a tightly coupled example of how to use Immutable.js cursors | |
// together with React and a Reflux-like store | |
// The store should be Reflux-like: the store is emitted to components using this.trigger() | |
// The store should emit this.stateCursor when components ask for its current state | |
var TurtlesStore = SomeStoreFactory.createStore({ | |
init: () => { | |
this.state = Immutable.fromJS({turtles: []}); | |
this.stateCursor = this._cursorRec(this.state); |