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
| /*jslint browser: true, plusplus: true */ | |
| (function ($) { | |
| "use strict"; | |
| var ComboBreaker = function (combo, callback, options) { | |
| var index = 0, timeout = null; | |
| if (!(this instanceof ComboBreaker)) { return new ComboBreaker(combo, callback, options); } | |
| this.options = $.extend({}, { |
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 Player | |
| def initialize | |
| @directions = [:forward, :right, :backward, :left] | |
| @initialized = false | |
| @state = :exploring | |
| @explored = Set.new | |
| @unexplored = Set.new | |
| end | |
| def damaged_last_turn? |
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
| #user nobody; | |
| worker_processes 1; | |
| pid /tmp/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| } |
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 SomeObject(object): | |
| def __init__(self, foo, bar): | |
| self.foo = foo | |
| self.bar = bar | |
| def get_foo(self): | |
| return self.foo | |
| def get_bar(self): | |
| return self.bar |
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; | |
| [RequireComponent(typeof(Light))] | |
| public class Flashlight : MonoBehaviour { | |
| public GameObject source; | |
| public AudioClip toggleSound; | |
| Light _light; | |
| // Use this for initialization |
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
| Vector2 mousePos = _camera.ScreenToWorldPoint(Input.mousePosition); | |
| Vector2 aimDirection = mousePos - (Vector2)_transform.position; | |
| float aimAngle = Vector2.Angle(_transform.up, aimDirection); | |
| if (Vector3.Cross(_transform.up, aimDirection).z > 0) | |
| { | |
| aimAngle = 360 - aimAngle; | |
| } | |
| Vector3 newPos = new Vector3(_transform.position.x + bulletSpawnRadius * Mathf.Sin(aimAngle * Mathf.Deg2Rad), | |
| _transform.position.y + bulletSpawnRadius * Mathf.Cos(aimAngle * Mathf.Deg2Rad), |
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
| describe('$resource', function () { | |
| var $httpBackend, | |
| $rootScope, | |
| Tasks; | |
| beforeEach(module('ngResource')); | |
| beforeEach(inject(function (_$httpBackend_, _$rootScope_) { | |
| $httpBackend = _$httpBackend_; | |
| $rootScope = _$rootScope_; |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = "hashicorp/precise64" | |
| config.vm.provision "docker" do |d| |
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
| angular.module('dialogBox', []) | |
| .factory('DialogBox', function ($q) { | |
| var instances = {}; | |
| function DialogBox (name) { | |
| if (!instances[name]) { | |
| instances[name] = $q.defer(); | |
| } | |
| instances[name].resolve(this); |
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 EventConsumer : MonoBehaviour | |
| { | |
| EventProvider ep; | |
| void Awake () | |
| { | |
| ep = GetComponent<EventProvider>(); |