Skip to content

Instantly share code, notes, and snippets.

View yonigoldberg's full-sized avatar

Yoni Goldberg yonigoldberg

  • Dynamic Labs
  • Miami
View GitHub Profile
@yonigoldberg
yonigoldberg / gist:6a64da35ad17f4e6a50a5e9444622d85
Created March 7, 2024 23:26
A simple python script to print all the aggregated open PRs by user
import requests
# Configuration
TOKEN = '' # Replace with your personal token
OWNER = '' # Replace with the repository owner's username
REPO = '' # Replace with the repository name
HEADERS = {
'Authorization': f'token {TOKEN}',
'Accept': 'application/vnd.github.v3+json'
@yonigoldberg
yonigoldberg / isBrowser.tsx
Last active March 16, 2023 21:30
React component to disable children that are not suitable for SSR (Rehydration)
import { ReactNode, useState, useEffect } from 'react';
type IsBrowserProps = {
children: ReactNode;
};
export const IsBrowser = ({ children }: IsBrowserProps) => {
const [isBrowser, setIsBrowser] = useState(false);
// this useEffect does not run during SSR
Verifying that +yonigoldberg is my blockchain ID. https://onename.com/yonigoldberg
@yonigoldberg
yonigoldberg / .bash_profile
Last active August 29, 2015 14:18
Pimp your git
#functions for showing git repo status on the command line
# * uncommitted changes
# ^ stashed changes
# > ahead of origin
# < behind origin
# ↕ diverged from origin
# R rebasing
function parse_git_dirty() {

Keybase proof

I hereby claim:

  • I am yonigoldberg on github.
  • I am yoni (https://keybase.io/yoni) on keybase.
  • I have a public key whose fingerprint is A128 FD77 7A7C B742 6E06 7540 1F22 D47C A662 5848

To claim this, I am signing this object:

@yonigoldberg
yonigoldberg / MagicLand.java
Created February 20, 2013 14:59
Super easy override
public class MagicLand {
public static void main(String[] args) {
for (int i = 0; i < (Math.random() * 500) + 2; i++) {
if (Unicorn.pat()) {
System.out.println("UNICORN #1: PAT THIS UNICORN ONCE");
}
}
for (int i = 0; i < (Math.random() * 500) + 2; i++) {
if (Unicorn.pat()) {