Skip to content

Instantly share code, notes, and snippets.

Alan Chavez alanchavez88

Block or report user

Report or block alanchavez88

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .profile
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
export PATH=$PATH:/Users/az/Library/Android/sdk/platform-tools/
export PS1="\[\033[36m\]\u\[\033[32m\]\[\033[97m\]@\[\033[32m\]\h:\[\033[93m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\]$ "
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@alanchavez88
alanchavez88 / .eslintrc
Created Sep 10, 2017
ESLint configuration file
View .eslintrc
{
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"rules": {
"no-alert": "off",
"no-array-constructor": "off",
View pathfinding.as
package
{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.MovieClip;
public class pathfinding extends Sprite
{
View Astar.as
package
{
public class Astar
{
private var _abierto:Array;
private var _cerrado:Array;
private var _cuadricula:Cuadricula;
private var _nodoFinal:Nodo;
private var _nodoInicial:Nodo;
private var _ruta:Array;
View procesar.php
<?php
require_once('conexion.php'); // Definicion de bases de datos y demas boberias
$nombre = substr($_POST['nombre'], 0, 49); //Truncar la cadena de texto a los primeros 50 caracteres.
$nombre - filter_var($nombre, FILTER_SANITIZE_SPECIAL_CHARS); // Codificar caracteres HTML.
$telefono = string_replace(array('+','-','.'), $_POST['telefono']);// Eliminamos caracteres especiales del telefono
$telefono = filter_var($telefono, FILTER_SANITIZE_NUMBER_INT); // Nos aseguramos que solamente queden numeros en la cadena de texto
$telefono = substr($telefono, -10); // Seleccionamos los ultimos 10 caracteres del numero, ignorando el codigo del pais.
@alanchavez88
alanchavez88 / consulta2.sql
Created Jun 10, 2014
Consulta SQL por programadores listillos
View consulta2.sql
SELECT
nombre,
telefono
FROM
Contactos C
WHERE
C.telefono LIKE "%868%";
@alanchavez88
alanchavez88 / consulta.sql
Created Jun 10, 2014
Consulta SQL para extraer numeros de telefono de la base de datos
View consulta.sql
SELECT
nombre,
telefono
FORM
Contactos C
WHERE
C.telefono LIKE "868%";
View formulario.html
<form id="formulario-inepto" action="procesar.php" method="POST">
Nombre: <input type="text" name="nombre" placeholder="Escribe tu Nombre"/>
Telefono: <input type="tel" name="telefono" placeholder="(555)-555-5555" />
<button value="Enviar Formulario"></button>
</form>
@alanchavez88
alanchavez88 / receptor.as
Last active Aug 29, 2015
Como enviar información de un SWF a otro en AS3
View receptor.as
// crea conexion local
var receive_lc:LocalConnection = new LocalConnection();
// permite comunicacion entre SWFs entre diferentes dominios
receive_lc.allowDomain("*");
// Espera por conexiones entrantes.
// Este comando tiene que ejecutarse ANTES de que el otro SWF envie información.
receive_lc.connect("_connection1");
@alanchavez88
alanchavez88 / 0_reuse_code.js
Created Feb 7, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.