Skip to content

Instantly share code, notes, and snippets.

View nesheroj's full-sized avatar
🤔
Should I start another side project?

Ness Hernández Ojeda nesheroj

🤔
Should I start another side project?
  • London
View GitHub Profile
@nesheroj
nesheroj / webpack.config,js
Created November 11, 2014 08:36
webpack & phaser
var fs = require("fs");
var path = require("path");
var webpack = require("webpack");
var isDirectory = function (file) {
return fs.statSync(path.join('./src/games/', file)).isDirectory();
};
var entries = {
gamenginename: "./gamenginename/main.js",
@nesheroj
nesheroj / gist:7548079
Created November 19, 2013 16:26
Angular directive for validating a spanish bank account number (SICA)
define(['app/main'], function (app) {
app.register.directive('isSica', function () {
return {
restrict: 'A',
require: 'ngModel',
link: function (scope, elem, attr, ngModel) {
function controlDigit(input) {
var weights = [1, 2, 4, 8, 5, 10, 9, 7, 3, 6];
var sum = 0;
for (var i = 0; i < weights.length; i++) {
@nesheroj
nesheroj / gist:7547978
Created November 19, 2013 16:22
Angular Validation directives for Spain's National IDs
define(['app/main'], function (app) {
app.register.directive('isDniNie', function () {
return {
restrict: 'A',
require: 'ngModel',
link: function (scope, elem, attr, ngModel) {
var charsDNINIE = 'TRWAGMYFPDXBNJZSQVHLCKE';
function isValidDNINIE(input) {
input = input.replace("-", "").toUpperCase();