Skip to content

Instantly share code, notes, and snippets.

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

Daniel Bernal bernaldani

🏠
Working from home
View GitHub Profile
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
@bernaldani
bernaldani / grads.md
Last active February 11, 2021 23:03
Instala grads mac

Instalación de grads 2.2.1 -- fecha 11 de febrero 2021 - Mac Big Sur 11.2


Instalar XQuartz

https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.11.dmg

Instalar Grads

brew install grads
@bernaldani
bernaldani / Response.php
Created September 10, 2020 16:14 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@bernaldani
bernaldani / mysql_query_log.md
Created September 3, 2020 01:26 — forked from joseluisq/mysql_query_log.md
How to enable the MySQL/MariaDB general query logs

How to enable the MySQL/MariaDB general query logs

  1. Enter to MySQL/MariaDB server command-line tool (change root with your username and password):
mysql -u root -proot
  1. Set the general log file path:
SET GLOBAL general_log_file='/var/log/mysql/mycustom.log';
@bernaldani
bernaldani / extract_data.py
Created December 23, 2019 16:46 — forked from bkaankuguoglu/extract_data.py
This program extracts regular expressions within the given frame on a set of documents.
#=======================================================================#
# extract_data.py #
#=======================================================================#
# usage: extract_data.py [-h] [-i INPUT_DIR] [-o OUTPUT_DIR]
#
# This program extracts provision numbers from a set of documents.
#
# optional arguments:
# -h, --help show this help message and exit
# -i INPUT_DIR, --input_dir INPUT_DIR
@bernaldani
bernaldani / git-deployment.md
Created August 23, 2019 14:26 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@bernaldani
bernaldani / highchart_image
Created April 23, 2019 18:17
render image in highchart chart
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
events: {
load: function() {
this.renderer.image('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQgmh52oZ_8ZZBzYDD94qNG182X96q3PwlBRNrXbJlWTUEFd9e79Q', 60, 20, 50, 50)
.add();
}
}
lang: {
loading: 'Cargando...',
months: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio',
'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
shortMonths: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
weekdays: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
decimalPoint: ',',
resetZoom: 'Restaurar zoom',
resetZoomTitle: 'Restaurar zoom nivel 1:1',
thousandsSep: '.'
@bernaldani
bernaldani / geojson.php
Created October 12, 2017 02:54 — forked from wboykinm/geojson.php
Sample PHP to Point GeoJSON
<?php
/**
* PHP GeoJSON Constructor, adpated from https://github.com/bmcbride/PHP-Database-GeoJSON
*/
# Connect to MySQL database
$conn = new PDO('mysql:host=localhost;dbname=mydatabase','myusername','mypassword');
# However the User's Query will be passed to the DB:
$sql = 'SELECT * from GDA_database WHERE user_query = whatever';
@bernaldani
bernaldani / gist:ef7b9a755062de6be0a34b9a46da4bb6
Created October 12, 2017 02:51 — forked from johnzastrow/gist:3927137
PHP Spatialite to GeoJSON
<?php
/**
* Spatialite to GeoJSON
It needs:
* apache2
* php5-cli
* php5-sqlite