Skip to content

Instantly share code, notes, and snippets.

View mattparrilla's full-sized avatar

Matt Parrilla mattparrilla

View GitHub Profile
// This is universal, works with Infura -- set provider accordingly
const ethers = require('ethers')
//const provider = ethers.getDefaultProvider('rinkeby')
const provider = new ethers.providers.JsonRpcProvider(process.env.WEB3_URL)
function hex_to_ascii(str1) {
var hex = str1.toString();
var str = '';
for (var n = 0; n < hex.length; n += 2) {
@mattparrilla
mattparrilla / .svn_completion_remote_paths.sh
Created October 24, 2017 18:05 — forked from androa/.svn_completion_remote_paths.sh
A tiny implementation of bash auto completion of remote paths when using Subversion. Requires that you have a working copy and are using ^/ to indicate that it's a remote url. Add the following file and add "source ~/.svn_completion_remote_paths" to your ~/.bash_profile
#!/bin/bash
function complete_remote_paths() {
word_to_complete=${COMP_WORDS[COMP_CWORD]}
command_line=${COMP_LINE}
# If the command line contains ^/ we should start completing
if [[ "$command_line" == *^/* ]]; then
# Create a base path for svn to use which only contains complete folder
# names. Examples:
# ^/bra => ^/
@mattparrilla
mattparrilla / views.py
Last active June 12, 2016 22:13 — forked from joeydi/views.py
Form/FormSet cleaned_data handling
cleaned_data = (
[self.process_cleaned_data(form_data) for form_data in cleaned_data] if isinstanced(cleaned_data, list)
else self.process_cleaned_data(cleaned_data)
)