Skip to content

Instantly share code, notes, and snippets.

View knownasilya's full-sized avatar
🦾
Working on Archegos

Ilya Radchenko knownasilya

🦾
Working on Archegos
View GitHub Profile
@knownasilya
knownasilya / gist:3691081
Created September 10, 2012 13:55
Get axes for triangle and AABB.
public static Vector3d[] getAABBAxes( Vector3d[] vertices ) {
Vector3d[] axes = new Vector3d[ 6 ];
// get vertices
Vector3d p0 = vertices[ 0 ];
Vector3d p1 = vertices[ 1 ];
Vector3d p2 = vertices[ 2 ];
Vector3d p3 = vertices[ 3 ];
Vector3d p4 = vertices[ 4 ];
Vector3d p5 = vertices[ 5 ];
@knownasilya
knownasilya / gist:3691088
Created September 10, 2012 13:57
project on axes
public static Projection project( Vector3d[] vertices, Vector3d axis ) {
double min = axis.dot( vertices[ 0 ] );
double max = min;
for (int i = 1; i < vertices.length; i++) {
// NOTE: the axis must be normalized to get accurate projections
double p = axis.dot( vertices[ i ] );
if ( p < min ) {
min = p;
} else if ( p > max ) {
max = p;
@knownasilya
knownasilya / binding.js
Created May 30, 2013 20:34
Ember Bindings
toggleMapSize: function () {
this.set("isFullWidth", !this.get("isVisible"))
}.observes("isVisible")
@knownasilya
knownasilya / SidebarView.js
Created May 31, 2013 19:57
Sidebar - Simple Ember view.
App.SidebarView = Ember.View.extend({
templateName: "sidebar",
elementId: "sidebar",
// These are bindings between classes and view properties, sweet!
classNameBindings: ["position", "isVisible"],
position: "right",
isVisible: true,
settings: null,
// Called after the element is created but
// right before it's inserted into the DOM
@knownasilya
knownasilya / commands
Created June 1, 2013 01:36
Rails Production update
git pull origin master
# merge or what not here..
bundle
bundle exec rake db:migrate
bundle exec rake assets:precompile
touch tmp/restart.txt
# Debugging
http://guides.rubyonrails.org/debugging_rails_applications.html
@knownasilya
knownasilya / MapSearchRoute.js
Last active December 18, 2015 00:58
Navigation
App.MapSearchRoute = Ember.Route.extend({
renderTemplate: function() {
this.render({
into: "sidebar",
outlet: "sidebar"
});
}
});
App.SidebarContentView = Ember.ContainerView.extend({
classNames: ["content"],
classNameBindings: ["isVisible"],
isVisible: false,
childViews: ["searchView", "overlayView", "contactView"],
searchView: App.MapSearchView,
overlayView: App.MapOverlayView,
contactView: App.MapContactView,
changeView: function (viewProperty) {
var arr = this.get("childViews");
@knownasilya
knownasilya / router.js
Created June 7, 2013 20:25
Basic Router
App.Router.map(function () {
this.route("index", { path: "/" });
this.resource("map", function () {
this.route("search");
this.route("overlay");
this.route("contact");
});
this.resource("surveys", { path: "/survey" }, function () {
App.CustomSelectView = Ember.View.extend({
templateName: "customSelect",
tagName: "ul",
classNames: ["custom-select"],
title: "Custom Select",
selected: null,
options: null,
click: function (event) {
console.dir(event.target);
},
jQuery191023943386389873922_1370972233957 (
{
"displayFieldName": "ANCHORNAME",
"fieldAliases": {
"CAIID": "CAIID",
"CAICAT": "Category",
"ANCHORNAME": "ANCHOR NAME",
"ADDRESS": "ADDRESS",
"BLDGNBR": "Building Number",
"CITY": "CITY",