Skip to content

Instantly share code, notes, and snippets.

View treethought's full-sized avatar
💃

Cam Sweeney treethought

💃
View GitHub Profile
@crazygit
crazygit / parseTransaction.go
Last active April 25, 2024 00:49
Parse Ethereum Transaction, Decode input data, Decode output data
package main
import (
"context"
"encoding/hex"
"fmt"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
# Use Google Cloud Platform stackdriver with python structlog
from google.cloud.logging import Client
from google.cloud.logging import _helpers
from google.cloud.logging.handlers import CloudLoggingHandler
from google.cloud.logging.handlers.transports.background_thread import _Worker
# pip install python-json-logger
from pythonjsonlogger import jsonlogger
@mxactvtd
mxactvtd / TidalCyclesQuickReferenceStub.tidal
Last active March 8, 2024 21:19
TidalCycles Quick Reference compiled and partially rewritten documentation from various sources
---- TidalCycles QUICK REFERENCE ----
----------------------------------------------------------------
-- To use in your editor after or alongside your code for quick reference
-- Work in progress, mostly to be used as basis for further documnentation work, sorry for the errors and omissions
-- designed with atom - monokai one dark vivid as theme
-- https://gist.github.com/mxactvtd/bf3fb357a419c7f063b98dfd9a66cf78 - check for update, I keep updating this quite often atm
----------------------------------------------------------------
-- Some sources of Documentation --
-- https://tidalcycles.org/patterns.html
-- https://tidalcycles.org/functions.html
@savasadar
savasadar / BCAddressField.py
Last active February 20, 2019 14:17
Python code for validating bitcoin address
#
# DJango field type for a Bitcoin Address
#
import re
from django import forms
from django.forms.util import ValidationError
from Crypto.Hash import SHA256
class BCAddressField(forms.CharField):
default_error_messages = {
@furui
furui / ExtendedChips.vue
Created March 18, 2017 10:10
Auto-completing Chips for Quasar
<template>
<div
class="q-chips group textfield"
@click="focus"
:class="{active: active, disabled: disable, readonly: readonly}"
>
<span
class="chip label bg-light text-grey-9"
v-for="(label, index) in value"
:key="index"
@RussellLuo
RussellLuo / grpc_pi.py
Last active April 15, 2020 10:35
gRPC client interface for Python: generation script and mocking class.
# -*- coding=utf-8 -*-
"""Generate a pythonic interface based on the code generated by `grpcio-tools`.
Example:
$ python grpc_pi.py --proto-package-name='xx' --pb2-module-name='python.path.xx_pb2'
"""
import argparse
import itertools
@raineorshine
raineorshine / solidity-resources-and-tools.md
Created July 27, 2016 14:33
Solidity Resources & Tools

Best practices and tools are a bit scattered, and of course very much a work in progress since the community is still developing. You may be disappointed to find that there is not a cohesive, centralized set of best practices and workflow. My personal opinion is that truffle offers one of the most cohesive development experiences today, although over time you will likely find yourself doing most of your work one level of abstraction down: at the web3 layer. Here are some resources and tools that I have found useful.

Resources

Frameworks

@samuelcolvin
samuelcolvin / heroku_rq_worker.py
Last active August 25, 2018 19:50
Custom Worker for RQ which does a better job of coping with Heroku's dyno shutdown process
import os
import signal
import errno
import random
import rq.queue
from rq.worker import signal_name, StopRequested, logger as rq_logger
IMMINENT_SHUTDOWN_DELAY = 6
@anvaka
anvaka / 00.Intro.md
Last active May 5, 2024 12:24
npm rank

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
@trinitronx
trinitronx / iterm_open_with
Last active June 26, 2021 01:19 — forked from sos4nt/iterm_open_with
Semantic history command for iTerm2 and Sublime Text 3. Allows iTerm integration of Command+Click to open a file in default app (if non-text), or Sublime Text with optional line number and column. Detects relative paths based on PWD.
#!/bin/sh
# iterm_open_with - open a URL, file from CWD, full path, or path with linenumber in default app or Sublime Text if text file
# For usage with iTerm2:
# In iTerm's Preferences > Profiles > Default > Advanced > Semantic History,
# choose "Run command..." and enter "/your/path/to/iterm_open_with \5 \1 \2".
# Usage: iterm_open_with $(pwd) filename [linenumber]
# $(pwd) = current working directory (either use `pwd` or $PWD)
# filename = filename to open
# lineno = line number
pwd=$1