Skip to content

Instantly share code, notes, and snippets.

View AntiGameZ's full-sized avatar

Sijie Chen AntiGameZ

View GitHub Profile
/**
* // This is the robot's control interface.
* // You should not implement it, or speculate about its implementation
* interface Robot {
* // Returns true if the cell in front is open and robot moves into the cell.
* // Returns false if the cell in front is blocked and robot stays in the current cell.
* public boolean move();
*
* // Robot will stay in the same cell after calling turnLeft/turnRight.
* // Each turn will be 90 degrees.
@AntiGameZ
AntiGameZ / The Technical Interview Cheat Sheet.md
Created June 17, 2017 21:49 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@AntiGameZ
AntiGameZ / CustomEvents.cs
Created April 19, 2017 23:34 — forked from stramit/CustomEvents.cs
Sending Custom Events via the EvenSystem
using System;
using System.Collections.Generic;
using UnityEngine.Events;
// interface you implement in your MB to receive events
public interface ICustomHandler : IEventSystemHandler
{
void OnCustomCode(CustomEventData eventData);
}
@AntiGameZ
AntiGameZ / backbone-monkey-patch.js
Created October 30, 2011 12:43 — forked from webmat/backbone-monkey-patch.js
Getting pagination information from headers with Backbone
// Get the pagination information from the response headers
// Wrap Backbone.sync to save the pagination header on the response object.
Backbone.sync_with_pagination = function(method, model, success, error) {
var success_with_pagination = function(resp, status, xhr) {
resp.next_page = xhr.getResponseHeader('X-Next-Page');
return success(resp);
}
return Backbone.sync_without_pagination(method, model, success_with_pagination, error);
};
@AntiGameZ
AntiGameZ / paginated_collection.js
Created October 30, 2011 12:43 — forked from io41/paginated_collection.js
Pagination with Backbone.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
@AntiGameZ
AntiGameZ / gist:1319111
Created October 27, 2011 09:06 — forked from disinfeqt/gist:1319014
Twitter bust
<script>
function bust () {
document.write = "";
window.top.location = window.self.location;
setTimeout(function() {
document.body.innerHTML = '';
}, 0);
window.self.onload = function(evt) {
document.body.innerHTML = '';
};