Skip to content

Instantly share code, notes, and snippets.

@Air-Craft
Air-Craft / jquery.plugin-template.js
Created October 20, 2011 10:56
jQuery Plugin Design Pattern/Template Improved!
// if (!window.L) { window.L = function () { console.log(arguments);} } // optional EZ quick logging for debugging
/**
* A modified (improved?) version of the jQuery plugin design pattern
* See http://docs.jquery.com/Plugins/Authoring (near the bottom) for details.
*
* ADVANTAGES OF EITHER FRAMEWORK:
* - Encapsulates additional plugin action methods without polluting the jQuery.fn namespace
* - Ensures ability to use '$' even in compat modes
*
@Air-Craft
Air-Craft / 15cc-WordPress-Plugin-Boilerplate.php
Created November 27, 2011 12:56
WordPress Plugin Class Boilerplate (in progress)
<?php
/*
Plugin Name: 15CC Modernizr Plus
Plugin URI: http://www.club15cc.com/WordPress-Modernizr-Plus
Description: Adds Modernizr and uses .load to rapidly download JS and CSS scripts in parallel. Plus adds support for HTML5 and MQ's to old browsers.
Version: 1.0
Author: Hari Karam Singh
Author URI: http://www.club15cc.com
License: MIT
*
@Air-Craft
Air-Craft / gist:1404442
Created November 29, 2011 11:11
PHP CSS Browser Selector
<?php
/*
PHP CSS Browser Selector v0.0.1
Bastian Allgeier (http://bastian-allgeier.de)
http://bastian-allgeier.de/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Credits: This is a php port from Rafael Lima's original Javascript CSS Browser Selector: http://rafael.adm.br/css_browser_selector
*/
@Air-Craft
Air-Craft / css_browser_selector.php
Created November 29, 2011 11:12
PHP CSS Browser Selector
<?php
/*
PHP CSS Browser Selector v0.0.2 (Update by Hari Karam Singh)
Bastian Allgeier (http://bastian-allgeier.de)
http://bastian-allgeier.de/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Credits: This is a php port from Rafael Lima's original Javascript CSS Browser Selector: http://rafael.adm.br/css_browser_selector
*/
@Air-Craft
Air-Craft / UIView+Marshmallows.h
Last active December 14, 2015 21:48
A UIView category of basic operations you kinda expect to be there but aren't. Contributions welcome!
#import <UIKit/UIKit.h>
@interface UIView (Marshmallows)
@property (nonatomic) CGFloat rotation;
/** @name Positioning convenience methods */
- (void)moveByDeltaX:(CGFloat)delX deltaY:(CGFloat)delY;
- (void)moveOriginToX:(CGFloat)theX;
- (void)moveOriginToY:(CGFloat)theY;
{
"count":10,
"total_count":10,
"current_page":1,
"pages":1,
"products":[
{
"product":{
"id":1060500593,
@Air-Craft
Air-Craft / GLKViewController-with-CeedGL-Boilerplate.m
Created July 31, 2013 09:35
A GLKVC with frag and vertex shaders as files and with the CeedGL lib. Coord space mapped to 0,0...1,1. #glsl #opengl
/*******
*** vertex.glsl ***********
uniform mat4 u_projection_matrix;
attribute vec4 a_position;
//attribute vec4 a_source_color;
varying vec4 v_position;
void main(void)
@Air-Craft
Air-Craft / GLSL-Wave-Equation.glsl
Created July 31, 2013 12:02
GLSL wave function give a 2D coordinate. Thanks: http://http.developer.nvidia.com/GPUGems/gpugems_ch02.html #wave #glsl #opengl #lib
#define VTXSIZE 0.80 // Amplitude
#define WAVESIZE 100.0 // Frequency
#define FACTOR 1.2
#define SPEED 2.0
#define OCTAVES 3
// Example of the same wave function used in the vertex engine
lowp float wave(lowp float x,
lowp float y,
lowp float timer)
@Air-Craft
Air-Craft / GLKView Boilerplate.mm
Last active August 29, 2015 13:59
GLKView Boilerplate #opengles #ios #animation #3d #boilerplate
//
// AC_CoverView.m
// AC Cover
//
// Created by Hari Karam Singh on 11/04/2014.
// Copyright (c) 2014 Air Craft. All rights reserved.
//
#import "AC_CoverView.h"
#import "GLKView+AC_Additions.h"
@Air-Craft
Air-Craft / indexed_touches_snippet.m
Created April 24, 2014 09:30
Quick snippet for actioning touches by touch down index, i.e. in sequence
// DNF: @implementation { NSMutableArray *_activeTouches }
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
for (UITouch *t in touches) {
NSUInteger idx = _activeTouches.count;
[_activeTouches addObject:t];
[self _updateForTouch:t withIndex:idx];
}
}