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 / findPropertyInNestedObject.ts
Last active May 9, 2024 19:25
Find Property in Nested Object
const originalObject = {
foo: {},
bar: "BAR",
baz: {
a: {},
b: {},
c: {
d: "DDD",
e: "EEE",
f: "FFF",
@topherPedersen
topherPedersen / App.tsx
Created April 7, 2024 20:52
React-Native Timeline Component Built with CSS (Prototype/Example)
import React from 'react';
import {
SafeAreaView, View,
} from 'react-native';
function App(): React.JSX.Element {
return (
<SafeAreaView style={{ flex: 1 }}>
<View>
<View style={{ flexDirection: 'row' }}>
@topherPedersen
topherPedersen / MainActivity.java
Created October 12, 2023 20:23
Display a Toast Message on Android (using Java)
package com.example.toastapp;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@Override
@topherPedersen
topherPedersen / DetectCollisionsBetweenHumanoids.lua
Created September 10, 2023 02:28
Detect Collisions Between Humanoids in Roblox
-- DisplayTextModule is some code I use to display text on screen for testing, if you see this in a code snippet, ignore this part
local DisplayTextModule = require(script.Parent.Parent.StarterGui.ScreenGui.Frame.TextLabel.DisplayTextModuleScript)
local Players = game:GetService("Players")
-- Works for R15, not sure if this works for R6 or not
local function partIsHumanoid(part)
if part.Name == "Head" then
return true
elseif part.Name == "UpperTorso" then
local DisplayTextModule = require(script.Parent.Parent.StarterGui.ScreenGui.OnScreenLogger.TextLabel.DisplayTextModuleScript)
DisplayTextModule.Display("hello, world")
local module = {}
function Display(text)
local textLabel = script.Parent
textLabel.Text = text
end
module.Display = Display
return module
@topherPedersen
topherPedersen / changeHumanoidsAppearance.lua
Last active September 10, 2023 00:52
Changing a Roblox Humanoid's Appearance
local Players = game:GetService("Players")
local function alterPlayer(player)
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local userId = player.UserId
local humanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(userId)
humanoidDescription.HeadColor = Color3.fromHex("#39FF14")
humanoidDescription.LeftArmColor = Color3.fromHex("#39FF14")
humanoidDescription.RightArmColor = Color3.fromHex("#39FF14")
@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