Skip to content

Instantly share code, notes, and snippets.

View totty90's full-sized avatar

Totty totty90

View GitHub Profile
// Generated on 2014-02-11 using generator-webapp 0.4.7
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
@totty90
totty90 / Add.js
Created February 20, 2014 12:39
React.js bug? getInitialState called more than once in a component lifecycle
define([
"react",
'future',
'API',
'../_helpers/index',
'../_helpers/ItemRenderer',
'./SelectArticleClassesStep',
'./SelectOperationClassesStep',
], function(
React,
@totty90
totty90 / 01 moduleA (return value).js
Last active August 29, 2015 14:03
Requirejs and Commonjs crossmodule standard boilerplate
(typeof define==="function"?define:function(f){var r=f(require,exports,module);module.exports=(r!==void 0?r:module.exports);})(function(require,exports,module){
return 27;
})
@totty90
totty90 / easy express example
Created September 8, 2014 16:19
easy express example
define(function(require, exports, module){
return function(args, cb, session){
var constants = require('client/constants');
var async = require('async');
var utils = require('client/utils');
var planetsToGive = args.planetsToGive;
var blockId = args.blockId;
var player = args.player;
@totty90
totty90 / A_Planets Multiplayer: Some source code
Last active August 29, 2015 14:07
Planets Multiplayer: Source code
- Game: http://54.77.31.219/
- Last version video: https://www.youtube.com/watch?v=5H3Pu4WFZD4
- Community: https://plus.google.com/u/1/communities/105437932515232469714
@totty90
totty90 / mission.js
Created February 23, 2015 17:17
SmartCSS with react
var React = require('react');
var Colors = require('client/ui/Colors');
var SmartCSS = require('SmartCSS');
var ProgressBar = require('client/ui/generic/ProgressBar');
var Icon = require('client/ui/icons/Icon');
var tinycolor = require('tinycolor');
var utils = require('utils');
@totty90
totty90 / Generated query
Last active August 29, 2015 14:17
Complex SQL queries
SELECT cod_fam,
nome_fam,
id_vendedor,
nome_vendedor,
id_zona,
conta_cli,
sub_conta_cli,
nome_cli,
Sum(venda1) AS VENDAS1,
Sum(venda2) AS VENDAS2,
SELECT cod_fam,
nome_fam,
id_vendedor,
nome_vendedor,
id_zona,
conta_cli,
sub_conta_cli,
nome_cli,
Sum(venda1) AS VENDAS1,
Sum(venda2) AS VENDAS2,
@totty90
totty90 / JS Signals
Created January 25, 2011 01:23
Javascript: inspired from actionscript 3 signals
var Signal = function(){}
Signal.prototype = {
init: function(){
this.listeners = [];
this.looping = false;
this.length = 0;
},
add: function(method, applyOn){
@totty90
totty90 / jquery-backbone version
Created January 1, 2014 16:32
React example vs jquery in pure javascript
var BuildTemplate = ' \
<h2 class="small-caps">build</h2> \
';
var BuildV = BaseV.extend({
className: 'btn-group-vertical',
initialize: function(o){
this.__player = o.player;