Skip to content

Instantly share code, notes, and snippets.

View peppemas's full-sized avatar
💭
Senior Architect and Game Developer

peppemas peppemas

💭
Senior Architect and Game Developer
  • Victrix Games
  • Italy
View GitHub Profile
@braustin20
braustin20 / SplineCharacter.cpp
Created May 30, 2018 17:25
Unreal 4 spline movement script
void ASplineCharacter::MoveRight(float Value)
{
if (GameStateRef == nullptr || GameStateRef->MovementSpline == nullptr)
{
AddMovementInput(FVector(0.f, -1.f, 0.f), Value);
return;
}
//Orient and move player in the direction of the spline
SplineDirection = GameStateRef->MovementSpline->Spline->FindDirectionClosestToWorldLocation(GetActorLocation(), ESplineCoordinateSpace::World);
@nbingham1
nbingham1 / inject_exif.py
Created January 4, 2017 20:30
Re-inject exif metadata into photos in a facebook archive
#!/usr/bin/python
from HTMLParser import HTMLParser
from PIL import Image
import piexif
import datetime
import sys
from fractions import Fraction
def rational(s):
f = Fraction(s).limit_denominator(10000000)
@hfreire
hfreire / rpi-usb.sh
Last active July 24, 2019 17:39
Enable/disable power on Raspberry Pi USB ports + Ethernet
#!/bin/sh
SOC_USB=/sys/devices/platform/soc/20980000.usb
if [ ! -d $SOC_USB ];
then
SOC_USB=/sys/devices/platform/soc/3f980000.usb # Raspberry Pi 3
fi
BUSPOWER=$SOC_USB/buspower
using UnityEngine;
using System.Collections;
// based on http://unitytipsandtricks.blogspot.com/2013/05/camera-shake.html
public class PerlinShake : MonoBehaviour
{
public float duration = 2f;
public float speed = 20f;
public float magnitude = 2f;
public AnimationCurve damper = new AnimationCurve(new Keyframe(0f, 1f), new Keyframe(0.9f, .33f, -2f, -2f), new Keyframe(1f, 0f, -5.65f, -5.65f));
@terrehbyte
terrehbyte / UsefulUnityAssets.md
Last active March 28, 2024 22:35
Useful Open-Source Unity Assets

Useful Open-Source Unity Assets

This is a compilation of various open-source Unity plugins, codebases, or utility scripts that may aid in expediting the development process.

Art / Design Tools

ProbePolisher - Light Probe Editor - keijiro

"ProbePolisher is a Unity Editor plugin for editing light probes. It works both on Unity Basic (free) and Unity Pro."

Code
Releases

@jpawlowski
jpawlowski / milight.pl
Last active September 25, 2022 20:17
LED Wifi control script for MiLight, EasyBulb, iBulb, LinkUP, Kepsun
#!/usr/bin/perl -w
#
# LED Wifi control script for MiLight, EasyBulb, iBulb, LinkUP, Kepsun
# ====================================================================
#
#
# Copyright (C) 2013, Julian Pawlowski <julian.pawlowski@gmail.com>
# All rights reserved.
#
# License: Simplified BSD / FreeBSD License
@astanin
astanin / sigmoid-bench.c
Last active July 6, 2023 16:54
Benchmark various sigmoid functions
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <math.h>
#define M_PI_2 1.57079632679489661923 /* pi/2 */
#define M_PI_2_INV (1.0/M_PI_2)
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
#define ERF_COEF (1.0/M_2_SQRTPI)
@stevenlr
stevenlr / gist:824019
Created February 12, 2011 19:21
plasma effect demoscene in C width SDL
#include <SDL/SDL.h>
#include <math.h>
typedef unsigned char uchar;
void ppixel(SDL_Surface *screen, int x, int y, uchar r, uchar g, uchar b);
int main(int argc, char *argv[])
{
SDL_Event event;