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
List<MapLayer> layers = new List<MapLayer>(); | |
MapSettings settings = new MapSettings(); | |
List<Ledge> ledges = new List<Ledge>(); | |
int[,] grid; | |
using (StreamReader r = new StreamReader(path)) | |
{ | |
settings.gravity = float.Parse(r.ReadLine(), CultureInfo.InvariantCulture); | |
settings.friction = float.Parse(r.ReadLine(), CultureInfo.InvariantCulture); | |
settings.mood = int.Parse(r.ReadLine()); |
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
"This ain't a scene it's a god damn arms race".replace(/god/g, "God"); |
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
# config file whatever.yml | |
development: | |
my_var: hello | |
test: | |
my_var: hello | |
production: | |
my_var: hello |
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
# is pretty simple, just require active support | |
require 'active_support/core_ext/hash' | |
hash = Hash.from_xml(xml) |
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
#!/usr/bin/env ruby | |
lib = File.expand_path(File.dirname(__FILE__) + '/../lib') | |
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib) | |
require 'my_gem' | |
require 'my_gem/command' | |
args = ARGV.dup | |
ARGV.clear |
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
# super simple way of coloring console output with ruby | |
# we extend string so we can simply call the method of the color on string literals, like so: | |
"This text should be blue!".blue | |
# and it will output a blue text string! | |
class String | |
# colorization |
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
# an array of lambdas | |
listeners = [] | |
# just some function that prints text | |
def callback_puts text | |
puts text | |
end | |
# add some listeners | |
listeners.push lambda{ callback_puts("Hello") } |
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.Linq; | |
using System.Text; | |
namespace OGLib.Utilities | |
{ | |
public class Pool<T> where T : class, new() | |
{ | |
private T[] items; |
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
rb_files = File.join('my_directory', '*.rb') | |
Dir.glob(rb_files).each do |file| | |
require_relative file | |
end |
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; | |
using System.Collections; | |
public class KillAfterTime : MonoBehaviour { | |
public float time = 0f; | |
float current = 0f; | |
void Update () { | |
current += Time.deltaTime; |
OlderNewer