Skip to content

Instantly share code, notes, and snippets.

View vanderlin's full-sized avatar

Vanderlin vanderlin

View GitHub Profile
@vanderlin
vanderlin / Simple Singleton
Last active August 29, 2015 13:56
Simple Singleton JS
var MyClass = (function() {
var instance;
function init() {
// Private
var className = "CLASS";
var cb;
var GlobalClass = (function () {
var propA = 33;
var name = "Something";
var callback;
return {
value:33,
stringvar:"some string",
sayThis: function(e) {
callback = e;
[super viewDidLoad];
[self.navigationController.navigationBar setBackgroundImage:[UIImage alloc] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[UIImage alloc]];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
self.navigationController.navigationBar.titleTextAttributes = @{NSFontAttributeName:[UIFont fontWithName:APP_FONT_MARK_OT_BOLD size:15], NSForegroundColorAttributeName:[UIColor whiteColor]};
// this is kinda a hack...
UIBarButtonItem *backButton = [[UIBarButtonItem alloc]
initWithTitle: @""
@vanderlin
vanderlin / gist:c36c59f8f7463c24c081
Created February 20, 2015 15:18
Stop Bootstrap from modal shift
.modal {
overflow-y: auto;
}
.modal-open {
overflow: auto;
}
.modal-open[style] {
padding-right: 0px !important;
}
@vanderlin
vanderlin / vue app
Created August 17, 2015 14:19
Basic Vue app
new Vue({
el:'#app',
props: ['authId'],
data: {
authId:null,
page:'profile-view'
},
ready: function() {
@vanderlin
vanderlin / SassMeister-input.scss
Created September 21, 2015 19:38
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$statement-colors:(
blue: #47E0E4,
magenta: #F3008C,
yellow: #FDF300,
musk: #C8BFBF,
gray: #8396A2,
int n = 10;
float xpos[] = new float[n];
float ypos[] = new float[n];
// --------------------------------------------------------
void setup() {
size(500, 500);
for (int i=0; i<n; i++) {
@vanderlin
vanderlin / GL Info
Last active December 18, 2015 10:38
static void getOpenGLCapabilities() {
printf("Getting OpenGL Capabilities\n");
// number of textures
GLint ntex;
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &ntex);
printf("Num Textures: %i\n", ntex);
// do we have point sprites
#include "testApp.h"
#include "ofxBox2d.h"
ofxBox2d box2d;
vector <ofxBox2dPolygon> triangles;
//--------------------------------------------------------------
void testApp::setup(){
ofSetFrameRate(30);
#include "testApp.h"
ofEasyCam camera;
ofVec3f posA, posB;
ofVec3f velA, velB;
bool bTouchingA, bTouchingB;
bool bPressedA, bPressedB;
static float minMouseDis = 15.0;