Skip to content

Instantly share code, notes, and snippets.

View ixtli's full-sized avatar
🌹
Typing text into boxes.

Chris Galardi ixtli

🌹
Typing text into boxes.
View GitHub Profile
@ixtli
ixtli / no-conflict.js
Created July 29, 2014 21:58
A thing that acts as a no-conflict stack for those times when you have to mutate the global namespace.
'use strict';
define(function(require)
{
var UNDEFINED = void 0;
function NoConflict(namespace)
#include <stdio.h>
class Person
{
public:
virtual void aboutMe() const {
printf("I am a person.\n");
}
};
@ixtli
ixtli / fb.js
Created August 13, 2014 15:21
Facebook double init
/** subsections of sdk.js retrieved on Aug 13th, 2014 */
function init(/*object|number|string*/ options) {__t([options, 'object|number|string', 'options']);
if (Runtime.getInitialized()) {
Log.warn(
'FB.init has already been called - this could indicate a problem');
}
if (Runtime.getIsVersioned()) {
@ixtli
ixtli / convert.py
Last active August 29, 2015 14:07
Convert XML to JSON using Python 2.7.x
#!/usr/bin/python
import xml.etree.ElementTree as ET;
import json, os, fnmatch, time;
def coerceStringToType(val):
if not val:
return None;
@ixtli
ixtli / test.js
Last active August 29, 2015 14:08
reflection in ember js
import Ember from 'ember';
var get = Ember.get;
/**
* Invoke this as such:
*
* ```handlebars
* {{ meta-input valueBinding='myModelAttr' }}
* ```
@ixtli
ixtli / unity.md
Last active August 29, 2015 14:08
Musings about how unity does 'masking'

Discovered various interesting things in the process of solving the masking issue, thought it would be good to circulate.

Masking in Unity

So the way masking works in Unity is by doing the following:

  • Each object contains a mask object (child) and then a bunch of other child objects
  • Mask object is given a masking shader
  • At render time, the mask "draws", but doesn't write color to the output buffer, it only writes depth. Another way to visualize this is that it creates an invisible 3D object that still blocks other objects behind it
  • When the other objects render, the parts that are behind the invisible objects get masked because the Z-buffer compare fails
  • Why can't you have two on the screen at once?
@ixtli
ixtli / .vimrc
Last active August 29, 2015 14:12
" A config meant for MacVim on OS 10.9/10.10
" Before running VundleInstall:
" Have powerline fonts installed (https://github.com/powerline/fonts)
" Install the reattach to user namespace stuff if using tmux
" 1) brew install reattach-to-user-namespace
" 2) add the following to .tmux.conf:
" set-option -g default-command "reattach-to-user-namespace -l /bin/bash"
"
" After running VundleInstall:
@ixtli
ixtli / .ycm_extra_conf.py
Created January 6, 2015 23:46
ycm extra conf 10.10
# Partially stolen from https://bitbucket.org/mblum/libgp/src/2537ea7329ef/.ycm_extra_conf.py
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
@ixtli
ixtli / reorder-container.js
Last active August 29, 2015 14:14
ember mixin
import Ember from 'ember';
var $ = Ember.$;
// These are defined in reorder-handle.scss
var DRAGGING_CLASS = 'is-dragging';
var DRAG_OVER_CLASS = 'drag-over';
var DROP_TARGET_CLASS = 'drop-target';
/**

Keybase proof

I hereby claim:

  • I am ixtli on github.
  • I am ixtli (https://keybase.io/ixtli) on keybase.
  • I have a public key whose fingerprint is 6073 D67A 89D2 5C5E CFC0 23A3 8B26 B1A8 AA91 34EA

To claim this, I am signing this object: