This file contains hidden or 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 const float PiOverTwo = (float)Math.PI * 2f; | |
| public static float SLerp(float x, float y, float amount) | |
| { | |
| float diff = (float)Math.Abs(y - x); | |
| if (diff > Math.PI) | |
| { | |
| if (y > x) | |
| x += PiOverTwo; |
This file contains hidden or 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
| class StringScrambler | |
| { | |
| private readonly char[] _scrambleLetters; | |
| private Random rand = new Random(); | |
| public StringScrambler(char[] scrambleLetters) | |
| { | |
| if (scrambleLetters == null) throw new ArgumentNullException("scrambleLetters"); | |
| _scrambleLetters = scrambleLetters; |
This file contains hidden or 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 class GameObject | |
| { | |
| private Vector2 originInPixels; | |
| public Vector2 position, scale, origin; | |
| public Color color; | |
| public Texture2D texture; | |
| public Rectangle source; | |
| public SpriteEffects flip; | |
| public float rotation; |
This file contains hidden or 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
| ScriptEngineManager manager = new ScriptEngineManager(); | |
| ScriptEngine engine = manager.getEngineByName("jruby"); | |
| if(engine == null){ | |
| System.out.println("failed to load jruby"); | |
| return; | |
| } | |
| ScriptContext context = engine.getContext(); |
This file contains hidden or 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
| require 'opengl' | |
| include Gl, Glu, Glut | |
| WIDTH = 512 | |
| HEIGHT = 512 | |
| NEAR = 0.1 | |
| FAR = 1000 | |
| class Vec3 | |
| attr_accessor :x, :y, :z |
This file contains hidden or 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
| EXEC sp_MSforeachtable @command1 = "DROP TABLE ?" |
This file contains hidden or 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
| git rm -r * | |
| git commit -m "fixed all bugs" |
This file contains hidden or 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
| g++ -F /Library/Frameworks -c main.cpp | g++ main.o -o main -framework sfml-window -framework sfml-graphics -framework sfml-system | exec ./main |
This file contains hidden or 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; | |
| using System.Collections; | |
| public class KillAfterTime : MonoBehaviour { | |
| public float time = 0f; | |
| float current = 0f; | |
| void Update () { | |
| current += Time.deltaTime; |
This file contains hidden or 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
| rb_files = File.join('my_directory', '*.rb') | |
| Dir.glob(rb_files).each do |file| | |
| require_relative file | |
| end |
NewerOlder