Skip to content

Instantly share code, notes, and snippets.

View ja6z's full-sized avatar
🗺️
On vacation

joel arraez ja6z

🗺️
On vacation
View GitHub Profile
@ja6z
ja6z / Firebaseauth.js
Last active April 14, 2021 04:22
Ejemplo de autenticación de firebase con nodejs
const firebase = require( "firebase");
firebase.initializeApp({
//Credenciales
})
//Ejemplo para registrar el usuario
firebase.auth().createUserWithEmailAndPassword("mail@mail.com", "passwords")
.then((userCredential) => {
// Signed in
@ja6z
ja6z / nanovg_sdl2.c
Created March 19, 2016 04:44
Attempt at combining nanovg and SDL2. Getting 'Error 00000500 after init' after creating the GL3 context in nanovg. Any ideas what's happening here?
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <SDL2/SDL.h>
#include "nanovg.h"
#define NANOVG_GL3_IMPLEMENTATION
#include "nanovg_gl.h"
@ja6z
ja6z / dabblet.css
Created August 3, 2015 04:12
Untitled
.loader {
width: 1em;
height: 1em;
border-radius: 50%;
background: transparent;
border-top: 0.2em solid #eeeeee;
border-right: 0.2em solid #eeeeee;
border-bottom: 0.2em solid #039BE5;
border-left: 0.2em solid #039BE5;
@ja6z
ja6z / serialize.js
Last active August 29, 2015 14:23 — forked from brettz9/serialize.js
/*jslint continue:true*/
/**
* Adapted from {@link http://www.bulgaria-web-developers.com/projects/javascript/serialize/}
* Changes:
* Ensures proper URL encoding of name as well as value
* Preserves element order
* XHTML and JSLint-friendly
* Disallows disabled form elements and reset buttons as per HTML4 [successful controls]{@link http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2}
* (as used in jQuery). Note: This does not serialize <object>
* elements (even those without a declare attribute) or
@ja6z
ja6z / login.php
Last active August 29, 2015 14:21
<?php
if(isset($_SESSION['authentication'])){?>
<script type="text/javascript">
<!--
window.location = "main.php"
//-->
</script>
You're already logged in, redirecting you.
<?php }else{
@ja6z
ja6z / dabblet.html
Created May 15, 2015 03:06
Untitled
<script>
function passwordChanged() {
var strength = document.getElementById('strength');
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\W).*$", "g");
var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g");
var enoughRegex = new RegExp("(?=.{6,}).*", "g");
var pwd = document.getElementById("password");
if (pwd.value.length==0) {
strength.innerHTML = 'Type Password';