Skip to content

Instantly share code, notes, and snippets.

View claudiainbytes's full-sized avatar

Claudia Estupiñán Forero claudiainbytes

View GitHub Profile
function Jugador(nombre, arma){
this.nombre = nombre;
this.puntaje = 0;
this.arma = arma;
}
Jugador.prototype.setArma = function() {
let armas = ["Piedra","Papel","Tijera"];
let aleatorio = Math.floor(Math.random() * (armas.length ));
this.arma = armas[aleatorio];
@claudiainbytes
claudiainbytes / rAF.js
Last active November 27, 2017 16:56 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
* {
/*border: 1px solid red !important;*/
font-family: 'Lato', sans-serif;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
public function handle($request, Closure $next)
{
return $next($request)
->header('Access-Control-Allow-Origin', '*')
->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
}
@claudiainbytes
claudiainbytes / gist:aa01d2e321a9d1db677f541e0dcaeec7
Last active September 6, 2017 18:58
customizing jquery form validator cedula and telephone
$.validate({modules : 'date, security', lang: 'es'});
// Add validator
$.formUtils.addValidator({
name : 'cedula',
validatorFunction : function(value, $el, config, language, $form) {
var patt = new RegExp("^[0-9]+$");
if( value.length > 7 && value.length < 13 && patt.test(value) ){
return true;
} else {
return false;
var projects = {
"projects": [
{
"title": "Sandwich Qbano",
"dates": "2011",
"description": "Concurso Música en Altamar",
"images": ["11-img-large.jpg", "11-img-small.jpg"]
},
{
"title": "Sweet Lemon",
//When you encapsule a function inside an object that
//function is called as a method whenever you need. Example:
//The object projects
var projects = {
"projects": [{
"title": "Project 1",
"description": "Lorem ipsum dolor sit amet"
},
{
var clickLocations = [];
function logClicks(x,y) {
clickLocations.push(
{
x: x,
y: y
}
);
console.log('x location: ' + x + '; y location: ' + y);
var work = {
"jobs": [
{
"employer": "Udacity",
"title": "Course Developer",
"location": "Mountain View, CA",
"dates": "Feb 2014 - Current",
"description": "Who moved my cheese cheesy feet cauliflower cheese. Queso taleggio when the cheese comes out everybody's happy airedale ricotta cheese and wine paneer camembert de normandie. Swiss mozzarella cheese slices feta fromage frais airedale swiss cheesecake. Hard cheese blue castello halloumi parmesan say cheese stinking bishop jarlsberg."
},
{
var name = "AlbERt EINstEiN";
function nameChanger(oldName) {
var finalName = oldName;
// Your code goes here!
finalName = finalName.toLowerCase();
finalName = finalName.split(" ");
finalName = finalName[0].charAt(0).toUpperCase() + finalName[0].slice(1) + " " + finalName[1].toUpperCase();