Skip to content

Instantly share code, notes, and snippets.

View edgarshurtado's full-sized avatar

Edgar S. Hurtado edgarshurtado

View GitHub Profile
@edgarshurtado
edgarshurtado / package.json
Created October 5, 2017 17:11
Example package.json for my blogpost explaining grunt
{
"name": "",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
@edgarshurtado
edgarshurtado / Gruntfile.js
Created October 5, 2017 17:07
example Gruntfile.js for my blogpost explaining grunt
module.exports = function(grunt){
require("load-grunt-tasks")(grunt);
grunt.initConfig({
"babel": {
options: {
sourceMap: true
},
dist: {
files: {
@edgarshurtado
edgarshurtado / horseMov.c
Created December 9, 2015 09:26
Movimiento Caballo
void horseMov(int *position){
int row = position[0];
int col = position[1];
int straightMov = 2;
int bendMov = 1;
//Moves with +- 2 col positions and +- 1 row positions
if(col + straightMov < COLS){
if(row - bendMov >= 0 && board[row - bendMov][col + straightMov] == EMPTY){
board[row - bendMov][col + straightMov] = MOVEMENT;
@edgarshurtado
edgarshurtado / checkDate.js
Created December 3, 2015 22:16
Validación de fecha con JavaScript
//------------------------------DATE CHECK-------------------------------------
// Returns if a given string date is valid. Months, days and years have the normal
// numeration starting from 1
// Valid formats for the string date: dd-mm-yy / dd/mm/yy / dd mm yy
function checkDate(dateString){
var dateStringParsed = parseDate();
if(dateStringParsed === null){
return false;