Skip to content

Instantly share code, notes, and snippets.

View treethought's full-sized avatar
💃

Cam Sweeney treethought

💃
View GitHub Profile
@munshkr
munshkr / App.jsx
Last active May 16, 2024 04:56
Hydra Synth hook for React
import { useHydra } from './useHydra'
import { useEffect } from 'react'
function App() {
const [canvasRef, hydraLoaded] = useHydra()
useEffect(() => {
if (!hydraLoaded) return;
// when it's loaded, run this script:
@crazygit
crazygit / parseTransaction.go
Last active September 7, 2024 22:42
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 August 15, 2024 14:40
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 November 15, 2024 07:27
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