This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using Box2DX.Collision; | |
using Box2DX.Common; | |
using Box2DX.Dynamics; | |
using SFML.Graphics; | |
using SFML.Window; | |
using Color = SFML.Graphics.Color; | |
namespace TestingSFML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class RendererExtensions | |
{ | |
public static bool IsVisibleFrom( this Renderer renderer, Camera camera ) | |
{ | |
Plane[] planes = GeometryUtility.CalculateFrustumPlanes( camera ); | |
return GeometryUtility.TestPlanesAABB( planes, renderer.bounds ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Regular dispatch table | |
Dictionary<string, Action> dispatch = new Dictionary<string, Action>(); | |
dispatch["help"] = new Action(() => Console.WriteLine("Hello :3")); | |
dispatch["dosomething"] = new Action(() => | |
{ | |
Console.WriteLine("Do Something else"); | |
}); | |
dispatch["help"](); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "ArxOrthoShadows" { | |
Properties { | |
_Color ("Main Color", Color) = (1,1,1,1) | |
_MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} | |
_BumpMap ("Normalmap", 2D) = "bump" {} | |
_Detail ("Detail (RGB)", 2D) = "gray" {} | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } | |
LOD 400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class CameraFollow : MonoBehaviour | |
{ | |
public Transform Target; | |
public float Damping = 1f; | |
public float LookAheadFactor = 3f; | |
public float LookAheadReturnSpeed = 0.5f; | |
public float LookAheadMoveTreshold = 0.1f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: Singletone<classtype>.Instance | |
public sealed class Singleton<T> where T : new() | |
{ | |
public static T Instance => Inner.InnerInstance; | |
private Singleton() { } | |
private class Inner | |
{ | |
internal static T InnerInstance = new T(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
YOUTUBEDL='/usr/local/bin/youtube-dl' # Absolute path to youtube-dl executable | |
ARCHIVE='~/youtube_archive' # Absolute path to archive | |
$YOUTUBEDL -U | |
archive () { | |
mkdir -p "$ARCHIVE/$1" | |
cd "$ARCHIVE/$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class BitmapExt | |
{ | |
public static void ChangeColour(this Bitmap bmp, byte inColourR, byte inColourG, byte inColourB, byte outColourR, byte outColourG, byte outColourB) | |
{ | |
// Specify a pixel format. | |
PixelFormat pxf = PixelFormat.Format24bppRgb; | |
// Lock the bitmap's bits. | |
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height); | |
BitmapData bmpData = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fossil -> Git | |
git init new-repo | |
cd new-repo | |
fossil export --git ../repo.fossil | git fast-import | |
git merge trunk | |
git branch -d trunk | |
Git -> Fossil | |
cd git-repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Collections.Concurrent; | |
using System.Threading.Tasks; | |
using System.Threading; | |
namespace TestProject | |
{ | |
class Program | |
{ |
OlderNewer