Skip to content

Instantly share code, notes, and snippets.

View tracend's full-sized avatar
🎯
Focusing

✌ Makis Tracend tracend

🎯
Focusing
View GitHub Profile
@tracend
tracend / underscore.inarray.js
Created December 20, 2013 19:07
inArray - Underscore mixin to find if a value exists in an array #cc #underscore
_.mixin({
inArray: function(value, array){
return array.indexOf(value) > -1;
}
});
@tracend
tracend / readme.md
Last active December 30, 2015 06:09
[DEPRECATED] Three.js Water shader based on the "water noise" example from @oosmoxiecode http://oos.moxiecode.com/js_webgl/water_noise/

Three.js Water

A simple watter shader based on the "water noise" example from @oosmoxiecode

Credits

Initiated by Makis Tracend

Resources

@tracend
tracend / undescrore.isEmail.js
Last active January 23, 2017 20:49
Underscore helper - checkif a string is a valid email
// isEmail underscore helper
// source: https://gist.github.com/tracend/7763827
_.mixin({
isEmail: function( email ){
var format = /^[a-zA-Z0-9\-_]+(\.[a-zA-Z0-9\-_]+)*@[a-z0-9]+(\-[a-z0-9]+)*(\.[a-z0-9]+(\-[a-z0-9]+)*)*\.[a-z]{2,4}$/;
return (email.match(format));
}
});
@tracend
tracend / .handlebars.operators.md
Last active August 28, 2025 14:49
Handlebars relational operators #handlebars #helper #cc

Handlebars relational operators

This is a series of MATLAB style relational operators for Handlebars.

Operators

  • eq - equal to
  • ne - not equal to
  • lt - less than
  • gt - greater than
@tracend
tracend / size.js
Created November 15, 2013 00:48
Calculate the size of an object
Object.size = function(obj) {
var size = 0, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) size++;
}
return size;
};
@tracend
tracend / underscore.random.js
Last active December 28, 2015 09:09
Underscore mixin to return a number between two values, optionally as an integer
_.mixin({
// a number between two values (default: 0 to 1000), optionally as an integer
random: function(min, max, int) {
// fallback(s)
min = min || 0;
max = max || 1000;
int = int || false;
// calculate the number
var num = Math.random()*(max-min) + min;
@tracend
tracend / $3d-asset.js
Last active December 27, 2015 23:39
Extending jQuery Three (github.com/makesites/jquery-three) with THREE.Asset support
Three.prototype.fn.webgl.asset = function( options, callback ){
// define the group (once)
if( !this.groups['asset'] ) this.groups['asset'] = "objects";
// model
var self = this;
var asset = new THREE.Asset( true );
asset.load( options.src, function ( geometry, materials ) {
@tracend
tracend / router.js
Created October 17, 2013 21:55
Concept for Backbone APP constructor class
define(["jquery", "underscore", "backbone"],
function( $, _, Backbone ){
// APP contructor
// based on backbone-app: https://github.com/makesites/backbone-app/blob/master/lib/app._construct.js
var APP = function(){
// get config
this.options = arguments[0] || {};
// check URIs

New order of Cloud Game Dev

Game development is becoming increasingly integrated with online services and real-time communication. Traditional game developers may need to step into the mindset of web developers to make sure their games survive in this new ecosystem.


Historically game developers didn't have to worry about the "real" world. Instead a video game was a contained environment and the focus was to try to make it as interactive and believable as possible. Fast forward to today and many games seem to be using the Internet in various ways. To change the state of these virtual worlds from contained to dynamic there needs to be a re-calibration in some of the basic development practices that have been established in previous decades. Web developers can assist in this area with their experience, as they have spent a lot of time and effort as a community to make their tools automated, network-based and dynamic. Among other benefits that's what allows them to be so efficient, and a web app made by

@tracend
tracend / index.html
Last active December 24, 2015 04:59
UI Alert: Legacy example using jQuery
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Alert</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<script type="text/javascript" src="//rawgithub.com/commons/common.js/master/build/common-min.js"></script>
<link rel="stylesheet" href="//rawgithub.com/commons/common.css/master/build/common-min.css" type="text/css" media="screen">