Skip to content

Instantly share code, notes, and snippets.

View topherPedersen's full-sized avatar
💭
Rolling my katamari ball

Christopher Pedersen topherPedersen

💭
Rolling my katamari ball
View GitHub Profile
@topherPedersen
topherPedersen / make_clones.py
Created August 20, 2019 22:49
Create Clones with Loops (for use with turtle graphics at trinket.io)
# Click in the righthand window to make it active then use your arrow
# keys to control the spaceship!
import turtle
import random
screen = turtle.Screen()
# this assures that the size of the screen will always be 400x400 ...
screen.setup(400, 400)
@topherPedersen
topherPedersen / greeter.ts
Last active March 5, 2023 09:03
Solana 101: Storing Data on the Solana Blockchain (From Figment.io's Solana 101 Course)
import {
Connection,
PublicKey,
Keypair,
SystemProgram,
Transaction,
sendAndConfirmTransaction,
} from '@solana/web3.js';
import type {NextApiRequest, NextApiResponse} from 'next';
import {getNodeURL} from '@figment-solana/lib';
@topherPedersen
topherPedersen / delete_old_branches.sh
Last active October 24, 2022 15:09
Delete Old Git Branches on Mac using Zsh Shell Script
#!/bin/zsh
# Put this script in your git repo: /Users/yourusername/yourrepo/delete_old_branches.sh
# Create a text file called old_branches.txt, put this in your repo as well: /Users/yourusername/yourrepo/old_branches.txt
# In old_branches.txt, put the names of the branches you want to delete. 1 Branch name per line, no commas.
# Then run...
# cd /Users/yourusername/yourrepo
# chmod 755 delete_old_branches.sh
# git config --global --add safe.directory /Users/yourusername/yourrepo
@topherPedersen
topherPedersen / keypair.ts
Created January 14, 2022 01:53
Solana 101: Creating Solana Accounts AKA Keypair (From Figment.io's Solana 101 Course)
import type {NextApiRequest, NextApiResponse} from 'next';
import {Keypair} from '@solana/web3.js';
/*
* Like with most Web 3 protocols, transactions on Solana happen between accounts.
* To create an account, a client generates a keypair which has a public key (or
* address, used to identify and lookup an account) and a secret key used to sign
* transactions.
*/
@topherPedersen
topherPedersen / YourCode.swift
Created August 5, 2022 16:27
Blog Post Embed (YourCode.swift): A Working Example of React Native Navigation External Components
let externalComponentName = "YourComponentName"
let viewController = YourViewController()
registerExternalComponent(externalComponentName, viewController)
@topherPedersen
topherPedersen / RNNUtility.m
Created August 5, 2022 16:26
Blog Post Embed (RNNUtility.m): A Working Example of React Native Navigation External Components
//
// RNNUtility.m
// yourapp
//
// Created by Christopher Pedersen on 8/5/22.
// Copyright © 2022 Super Sweet Co. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <ReactNativeNavigation/ReactNativeNavigation.h>
@topherPedersen
topherPedersen / RNNUtility.h
Created August 5, 2022 16:26
Blog Post Embed (RNNUtility.h): A Working Example of React Native Navigation External Components
//
// RNNUtility.h
// yourapp
//
// Created by Christopher Pedersen on 8/5/22.
// Copyright © 2022 Super Sweet Co. All rights reserved.
//
#ifndef RNNUtility_h
#define RNNUtility_h
@topherPedersen
topherPedersen / yourapp-Bridging-Header
Created August 5, 2022 16:25
Blog Post Embed (yourapp-Bridging-Header): A Working Example of React Native Navigation External Components
#import "RNNUtility.h"
@topherPedersen
topherPedersen / AppDelegate.m
Created August 4, 2022 01:49
Register React Native Navigation External Component in Swift
//#import "AppDelegate.h"
//#import <React/RCTBridge.h>
//#import <React/RCTBundleURLProvider.h>
//#import "RNNCustomViewController.h"
//#import <ReactNativeNavigation/ReactNativeNavigation.h>
class AppDelegate : RCTBridgeDelegate {
@topherPedersen
topherPedersen / App.js
Last active July 6, 2022 14:05
Custom Side-Menu / Drawer in React-Native (Demo/Prototype)
import React, { useState } from 'react';
import {
View,
SafeAreaView,
Dimensions,
Image,
} from 'react-native';
import { GestureDetector, Gesture } from 'react-native-gesture-handler';
import Animated, {
useSharedValue,