Skip to content

Instantly share code, notes, and snippets.

@bradtraversy
bradtraversy / typescript-crash.ts
Last active May 3, 2024 13:32
Basic intro to TypeScript (From YouTube Crash Course)
// Basic Types
let id: number = 5
let company: string = 'Traversy Media'
let isPublished: boolean = true
let x: any = 'Hello'
let ids: number[] = [1, 2, 3, 4, 5]
let arr: any[] = [1, true, 'Hello']
// Tuple
@runevision
runevision / Shadows.cginc
Last active May 3, 2024 13:32
Water Foam Particle Shader
UNITY_DECLARE_SHADOWMAP(_SunCascadedShadowMap);
float4 _SunCascadedShadowMap_TexelSize;
#define GET_CASCADE_WEIGHTS(wpos, z) getCascadeWeights_splitSpheres(wpos)
#define GET_SHADOW_FADE(wpos, z) getShadowFade_SplitSpheres(wpos)
#define GET_SHADOW_COORDINATES(wpos,cascadeWeights) getShadowCoord(wpos,cascadeWeights)
/**
* Gets the cascade weights based on the world position of the fragment and the poisitions of the split spheres for each cascade.
@runevision
runevision / BurstMethodTester.cs
Last active May 3, 2024 13:31
Using Unity Burst directly on methods without jobs - unofficial example code
using Unity.Burst;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using UnityEngine;
// This example code demonstrates using Unity Burst directly on a static method without jobs.
// Unity NativeArrays can't be used directly in Unity Burst methods (only in Burst jobs),
// so we have to pass pointers to arrays instead.
@cjddmut
cjddmut / EasingFunctions.cs
Last active May 3, 2024 13:31
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@mi-lee
mi-lee / unlike-delete-hide-facebook-posts.js
Last active May 3, 2024 13:30
Bulk delete, unlike, hide, or remove Facebook actions (in Activity Feed) by year.
// DISCLAIMER: I'VE ONLY RUN THIS SCRIPT ON MY OWN ACCOUNT ONLY. PROCEED/USE WITH RISK! I MADE THIS SCRIPT IN 20 MINUTES SO BE WARNED!
// On the other hand, I've deleted 50,000 comments in a matter of minutes so it's been pretty damn handy
// 1. Go to Activity feed, like facebook.com/<username>/allactivity
// 2. Navigate to specific section of FB, like "Likes and Reactions" or "Comments",
// like https://www.facebook.com/<username>/allactivity?privacy_source=activity_log&log_filter=cluster_<clusterid>
// 3. Navigate to year that you want to batch delete. You may need to scroll a little bit to let it load
// 4. Once you enter this there's no going back!!
@KarlRamstedt
KarlRamstedt / FirstPersonCameraRotation.cs
Created January 8, 2020 10:17
A simple First Person Camera rotation script for Unity.
using UnityEngine;
/// <summary>
/// A simple FPP (First Person Perspective) camera rotation script.
/// Like those found in most FPS (First Person Shooter) games.
/// </summary>
public class FirstPersonCameraRotation : MonoBehaviour {
public float Sensitivity {
get { return sensitivity; }
@aikiox
aikiox / Send-PingCastleReport.ps1
Last active May 3, 2024 13:28
PingCastle - Generate and send report after score comparison
<#PSScriptInfo
.VERSION 0.1
.GUID dcf37da6-cd01-43c7-8e51-a5ce735aab42
.AUTHOR Romain Tiennot
.COMPANYNAME Colibri SAS / ManoMano
.COPYRIGHT Copyright (c) Colibri SAS / Manomano 2021
.TAGS pingcastle security activedirectory
.PROJECTURI https://gist.github.com/aikiox/98f97ccc092557acc1ea958d65f8f361
@jasonwhite
jasonwhite / joystick.c
Last active May 3, 2024 13:28
Reads joystick/gamepad events on Linux and displays them.
/**
* Author: Jason White
*
* Description:
* Reads joystick/gamepad events and displays them.
*
* Compile:
* gcc joystick.c -o joystick
*
* Run:
@Knewest
Knewest / How to implement better anti-aliasing (AA) into Roblox and other games too).md
Last active May 3, 2024 13:26
Guide on how to implement better anti-aliasing (AA) into Roblox (and other games too).

How to implement better anti-aliasing (AA) into Roblox:


Introduction:

It should be noted that not all games will have the same process, and this guide mainly focuses on implementing AA in Roblox. This is because different games have different rendering engines and techniques, which may or may not make this possible. Sometimes AA is a built-in feature you can modify and change in the game.


What anti-aliasing (AA) is:

Anti-aliasing is a technique used in computer graphics to smooth out jagged edges and reduce visual artifacts, such as aliasing or "jaggies," which occur due to the limitations of rendering pixels on a digital display. AA works by blending the colors of pixels along the edges of objects to create a smoother transition between them. This results in a more visually pleasing and realistic appearance of curved or diagonal lines and edges.

Comparison o
@lopspower
lopspower / README.md
Last active May 3, 2024 13:26
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store