Skip to content

Instantly share code, notes, and snippets.

View oguimbal's full-sized avatar
🐜

Olivier Guimbal oguimbal

🐜
View GitHub Profile
@oguimbal
oguimbal / main.ts
Last active April 9, 2024 16:18
HyVM example: fetch multiple balances on-chain, in one call
import * as ethers from 'ethers';
export const ETH_ADDRESS: HexString = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee';
setImmediate(async () => {
const provider = ethers.getDefaultProvider();
const who: HexString = '0x945f803f01F443616546d1F31466c0E7ACfF36f7';
@oguimbal
oguimbal / celopunks-probas-on-cloudflare.js
Last active October 7, 2021 07:42
A quick & (very) dirty cloudflare worker script to compute probas & display your celopunks
const rarity = `
Background:
Celo Dark -> 15%
Celo Gray -> 10%
Faint Gold -> 75%
Character:
Green Cyber Woman -> 6%
!j::Send ^{Left}
!l::Send ^{Right}
!i::Send {Up}
!k::Send {Down}
!u::Send {Left}
!o::Send {Right}
!m::Send {End}
!ù::Send {Home}
[
// default usefull:
// CTRL+J => bottom panel
// CTRL+S => can be used to pin a tab
// CTRL+MAJ+; => open breadcrumbs
// CTRL+D => add next occurence of current selection to selection
// ALT+C => navigate to next error
// SHIFT+F5 => stop debugging
// CTRL+ALT+(up/down) => multi select
// CTRL+R => switch workspaces
@oguimbal
oguimbal / main.cs
Created July 31, 2019 22:10
Custom C# container demo
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using System.Linq.Expressions;

Keybase proof

I hereby claim:

  • I am oguimbal on github.
  • I am oliv (https://keybase.io/oliv) on keybase.
  • I have a public key whose fingerprint is 4063 5621 2E71 C73C E202 CF37 96CC B3CC 0FB8 22F0

To claim this, I am signing this object:

@oguimbal
oguimbal / ExpressionToPrettyString.cs
Last active April 19, 2016 08:44
Expression to pretty string template
public static class ToStringExpressionVisitorExtensions
{
public static string ToPrettyString(this IQueryable @this)
{
var v = new ToStringExpressionVisitor();
v.Visit(@this.Expression);
return v.sb.ToString();
}
}
@oguimbal
oguimbal / ExpressionSimplifier.cs
Created April 19, 2016 08:16
Simplify expressions by executing each subnode wich does not depends on an expression parameter
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Utilities
{
public static class ExpressionSimplifier
{
public static Expression<T> SimplifyLambda<T>(this Expression<T> expression)
{