Skip to content

Instantly share code, notes, and snippets.

View patriciomg's full-sized avatar
🎖️
I may be slow to respond.

Don Pato patriciomg

🎖️
I may be slow to respond.
  • KK
  • Germany
View GitHub Profile
@patriciomg
patriciomg / custom_log.js
Last active October 11, 2019 09:49
simple custom JS log function
// example
var Foo;
Foo = {
_debugMode: true,
init: function () {
Foo.log('initialising blah blah')
},
@patriciomg
patriciomg / home-routing.module.ts
Created September 19, 2019 10:45
angular 8 - redirect after x seconds
import { NgModule, OnInit } from '@angular/core';
import { Routes, RouterModule, Router } from '@angular/router';
import { HomeWelcomeComponent } from './home-welcome/home-welcome.component';
const routes: Routes = [
{ path: 'welcome', component: HomeWelcomeComponent }
];
@NgModule({
@patriciomg
patriciomg / convertip.sql
Created July 15, 2018 18:11 — forked from peterdalle/convertip.sql
Convert IP number to IP address in MySQL
# http://lite.ip2location.com/
# http://stackoverflow.com/questions/3650006/get-country-of-ip-address-with-php
# IP Number = 16777216*w + 65536*x + 256*y + z
# where IP Address = w.x.y.z
#
# To reverse IP number to IP address,
# w = int ( IP Number / 16777216 ) % 256
# x = int ( IP Number / 65536 ) % 256
# y = int ( IP Number / 256 ) % 256
@patriciomg
patriciomg / Dockerfile
Created July 2, 2018 16:22 — forked from remarkablemark/Dockerfile
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/debian/
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
@patriciomg
patriciomg / ParseInputStream.php
Created February 7, 2018 09:23 — forked from devmycloud/ParseInputStream.php
Process php://input to get multipart/form-data parameters for PATCH API request
<?php
use Illuminate\Support\Facades\Log;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* stream - Handle raw input stream
*
* LICENSE: This source file is subject to version 3.01 of the GPL license
* that is available through the world-wide-web at the following URI: