Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Design pooltogether.com

Chuck Bergeron chuckbergeron

🎯
Design pooltogether.com
View GitHub Profile
@chuckbergeron
chuckbergeron / selection-set-vs-id_in-array.gql
Last active Nov 13, 2020
Comparison of The Graph protocol query large dataset using selection set vs. `_in` array (run in the Uniswap v2 playground: https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2)
View selection-set-vs-id_in-array.gql
## // First query (slow, ~5 seconds):
{
tokens(where: {id_in: ["0xdac17f958d2ee523a2206206994597c13d831ec7", "0x0ae055097c6d159879521c384f1d2123d1f195e6", "0x0d438f3b5175bebc262bf23753c1e53d03432bde", "0x0d8775f648430679a709e98d2b0cb6250d2887ef", "0x1ceb5cb57c4d4e2b2433641b95dd330a33185a44", "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984", "0x23687d9d40f9ecc86e7666dddb820e700f954526", "0x28cb7e841ee97947a86b06fa4090c8451f64c0be", "0x439ce375e3ee4dc203d71958beca3c0f417d65cb", "0x531c3a8926e4c4b4cc50dc1de83e1e7fa0b2738e", "0x537a9095b78517597b5f2058edcd6e1978095909", "0x55801d4dbd6699a527c663e9f08fdbc080f87c3e", "0x58b6a8a3302369daec383334672404ee733ab239", "0x64795db64dc318c0e68cfb38eeb0b8e30b139b3e", "0x6b175474e89094c44da98b954eedeac495271d0f", "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2", "0x8daebade922df735c38c80c7ebd708af50815faa", "0x973e52691176d36453868d9d86572788d27041a9"]}) {
id
symbol
name
decimals
}
View pooltogether networks-kovan-42.json
[
{
"contractName": "Dai",
"address": "0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa"
},
{
"contractName": "Sai",
"address": "0xc4375b7de8af5a38a93548eb8453a498222c4ff2"
},
{
@chuckbergeron
chuckbergeron / CompileTime.cs
Created Dec 20, 2017
Unity Measure Compile Time
View CompileTime.cs
# // Originally found here: https://answers.unity.com/questions/1131497/how-to-measure-the-amount-of-time-it-takes-for-uni.html
using UnityEngine;
using UnityEditor;
[InitializeOnLoad]
class CompileTime : EditorWindow
{
static bool isTrackingTime;
static double startTime;
@chuckbergeron
chuckbergeron / BookOfShadersBlit.cs
Created Sep 18, 2016
Put this Monobehaviour on your Camera, it will take the `Custom/Plot.shader` file and render it over the screen -- https://gist.github.com/chuckbergeron/a9518c103a93318ffb092c2f4aa87133
View BookOfShadersBlit.cs
using System.Collections;
using UnityEngine;
public class BookOfShadersBlit : MonoBehaviour {
private Material _material;
private void Awake()
{
_material = new Material(Shader.Find("Custom/PlotShader"));
@chuckbergeron
chuckbergeron / plot.shader
Last active Sep 18, 2016
Shader code and camera Monobehaviour to render the example on The Book of Shaders pg. 5 in Unity 5.4.1 -- https://thebookofshaders.com/05/ -- https://gist.github.com/chuckbergeron/50adf7f5099bc85a25c9606246aca963
View plot.shader
Shader "Custom/PlotShader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
@chuckbergeron
chuckbergeron / DynamicCameraEffects.cs
Created Jul 5, 2016
Changing StandardAsset ImageEffects on Camera at runtime in Unity
View DynamicCameraEffects.cs
using DG.Tweening; // remove this if you're not using DOTween
using System.Collections;
using UnityEngine;
using UnityStandardAssets.ImageEffects;
/// <summary>
/// An extension class for dynamically adding noise to the camera easily at runtime
/// </summary>
public class DynamicCameraEffects : MonoBehaviour
{
@chuckbergeron
chuckbergeron / fb-opengraph-and-twitter-tumblr-tags.html
Created Jun 12, 2016
Facebook OpenGraph tags auto-generated by Tumblr
View fb-opengraph-and-twitter-tumblr-tags.html
<!-- (EXTRA) FACEBOOK TAGS -->
<meta property="al:ios:url" content="tumblr://x-callback-url/blog?blogName=astervoid2000" />
<meta property="al:ios:app_name" content="Tumblr" />
<meta property="al:ios:app_store_id" content="305343404" />
<meta property="al:android:url" content="tumblr://x-callback-url/blog?blogName=astervoid2000" />
<meta property="al:android:app_name" content="Tumblr" />
<meta property="al:android:package" content="com.tumblr" />
<!-- TWITTER TAGS -->
<meta charset="utf-8">
@chuckbergeron
chuckbergeron / ProCamera2DShaker.cs
Last active Aug 5, 2016
How I got the ProCamera2D Shake extension to work programmatically
View ProCamera2DShaker.cs
// SEE THE UPDATED, PURE CODE VERSION BELOW!
using UnityEngine;
using System.Collections;
using Com.LuisPedroFonseca.ProCamera2D;
public class ProCamera2DStagingShake : MonoBehaviour {
private ProCamera2DShake shaker;
View gist:77b30fefb3df5d004db4
Short Term 12
Dear Zachary: A Letter to ...
Detachment
Samsara
Broken
It's A Disaster
Citizenfour
The Naked Gun
Slow West
View keybase.md

Keybase proof

I hereby claim:

  • I am chuckbergeron on github.
  • I am chuckbergeron (https://keybase.io/chuckbergeron) on keybase.
  • I have a public key whose fingerprint is 5FFA 5CB7 C469 A068 67EF C0FD 5E65 4F76 1C1D 7F0E

To claim this, I am signing this object: