Skip to content

Instantly share code, notes, and snippets.

@samsheffield
samsheffield / UnityCodingCheatSheet.txt
Last active December 31, 2024 20:18
Unity C# Cheat Sheet
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
using UnityEngine;
using System.IO;
using System.Collections.Generic;
public class Frame
{
public static int VERSION = 1;
public double Timestamp;
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
@3on
3on / anti-virus.sh
Created April 16, 2016 20:05
Clean you mac from MacCleaner/Mackeeper malware in 3 steps.
# 1. List all the daemons running on you mac that are not published by apple.
# Search on google any name that you do not trust.
# MacKeeper has at least one with a strange name.
launchctl list | grep -v com.apple
# 2. Remove all the suspecious daemons.
# You won't be able to simply kill -9, they all restart each other and redownload themselves.
launchctl remove com.malware.something
# 3. Remove all associated files
#!/bin/bash
#
# Faster toolchain build: skips as much as possible.
#
# To use this toolchain from the command line:"
# export TOOLCHAINS=$(whoami)
#
# we build to the same prefix every time (instead of building
# to a versioned prefix) because every time the prefix changes
# *everything* rebuilds.
@zmwangx
zmwangx / plist2json
Last active August 26, 2022 17:19
Simple plist to JSON converter in Python.
#!/usr/bin/env python3
import argparse
import base64
import collections
import datetime
import json
import plistlib
import sys
import tempfile
using UnityEngine;
using System.Collections;
public class LinkedCamera : MonoBehaviour {
// What transform to chase:
public Transform target;
// Debug keyboard controls:
public KeyCode modifier;
public KeyCode incSmooth;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class CompanionCamera : MonoBehaviour {
// Debug shortcut keys:
public KeyCode modifier;
public KeyCode toggleButton;
// If true, this will permanently disable the SteamVR companion camera.
@david90
david90 / resizer.sh
Last active February 2, 2023 10:08 — forked from benvium/resizer.txt
#!/bin/bash -e
# Make sure you have installed ImageMagick
# http://cactuslab.com/imagemagick/
# Ensure we're running in location of script.
cd "`dirname $0`"
for f in *; do
if [[ $f == *@3x* ]];
then
@LearnCocos2D
LearnCocos2D / gist:4acd1eb6733192aab180
Last active May 31, 2017 17:55
GKMinmaxStrategist stub classes implementing the GKGameModel* protocols for Swift 2.0
/*
Swift classes implementing the GKMinmaxStrategizer protocols, without any logic.
You can use these as a template, copy & paste them into your project and start working. ;)
This gist is provided by http://tilemapkit.com and released into public domain.
Here's my tutorial about GKMinmaxStrategist: http://tilemapkit.com/2015/07/gkminmaxstrategist-build-tictactoe-ai/
*/
class TheGameModel: NSObject, NSCopying, GKGameModel {