Skip to content

Instantly share code, notes, and snippets.

View mikejavier's full-sized avatar
🏠
Working from home

Michael Santillán mikejavier

🏠
Working from home
View GitHub Profile
#!/usr/bin/env node
/**
* Pizza delivery prompt example
* run example by writing `node pizza.js` in your console
*/
'use strict';
var inquirer = require('inquirer');
<?php
namespace Leet;
class HttpKernel
{
public function __construct($routes)
{
$this->routes = $routes;
}
@mikejavier
mikejavier / server.js
Created August 3, 2018 16:13 — forked from joshj/server.js
Twitter OAuth with node-oauth for node.js+express
/*
Node.js, express, oauth example using Twitters API
Install Node.js:
curl -0 http://nodejs.org/dist/v0.6.11/node-v0.6.11.tar.gz
tar -zxf node-v0.6.11.tar.gz
cd node-v0.6.11
./configure
make
make install
@mikejavier
mikejavier / regex
Created September 12, 2017 14:03
Regular Expression for Perfect URL validation
//
// Regular Expression for Perfect URL validation
// License: MIT
//
/^(?:(?:https?):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/
//
// DEMO
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
@mikejavier
mikejavier / gh-pages-deploy.md
Created April 30, 2017 14:56 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@mikejavier
mikejavier / index.html
Last active December 5, 2016 11:01
CSS Grid Layout example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Experimento CSS Grid Layout</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrap">
<header class="header">
@mikejavier
mikejavier / bower.json
Last active December 5, 2016 10:49
bower init
{
"name": "mike-template",
"version": "0.1.0",
"authors": [
"Mike <[email protected]>"
],
"description": "template de inicializacao de front",
"moduleType": [
"node"
],
@mikejavier
mikejavier / index.js
Created December 5, 2016 02:47
hello world with nodejs
// Carga la biblioteca HTTP de Node.js.
var http = require('http');
// Crea un servicio web para tratar la petición de respuesta del mensaje Hola Mundo.
var server = http.createServer(function (request, response) {
// Establece los parámetros de respuesta.
@mikejavier
mikejavier / index.html
Last active December 5, 2016 02:43
basic page with html5 example
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Titulo</title>
</head>
<body>
<header>
<div class="logo"></div>
<nav class="menu">