Skip to content

Instantly share code, notes, and snippets.

View nicolascarrascob's full-sized avatar
💻

Nicolas Carrasco Barrera nicolascarrascob

💻
View GitHub Profile
/**
*Submitted for verification at Etherscan.io on 2021-10-21
*/
pragma solidity 0.8.9;
library LibPinball {
struct State {
bytes ball;
/* Estructura y Datos de las Regiones, Provincias */
/* y Comunas de Chile. */
/* */
/* Fecha: Julio 2010 */
/* Autor: Juan Pablo Aqueveque - juque.cl */
--
-- Comunas
--
DROP TABLE IF EXISTS `comunas`;
@nicolascarrascob
nicolascarrascob / LICENSE
Created November 12, 2020 20:34 — forked from noelbundick/LICENSE
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@nicolascarrascob
nicolascarrascob / tile_cacher.py
Created November 11, 2020 06:20
Script for request map tiles based on a BBOX, for seeding caches.
#!/usr/bin/env python
#
# Make requests to a tile server to seed the cache
# Created by Jesse Crocker, 6/30/2014
#
# This file is public-domain
#-------------------------------------------------------
from math import *
from optparse import OptionParser
@nicolascarrascob
nicolascarrascob / tolerance_per_zoom.md
Created November 11, 2020 04:42 — forked from lukasmartinelli/tolerance_per_zoom.md
ST_Simplify tolerance per zoom level
zoom_level tolerance
      0 |  78271.516953125
      1 | 39135.7584765625
      2 | 19567.8792382812
      3 | 9783.93961914062
      4 | 4891.96980957031
      5 | 2445.98490478516
      6 | 1222.99245239258

7 | 611.496226196289

nicolas@Notebook-Asus:~$ sudo vim /etc/php/7.4/mods-available/xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart = 1
#!/bin/bash
FROM_ENCODING="value_here"
TO_ENCODING="UTF-8"
CONVERT=" iconv -f $FROM_ENCODING -t $TO_ENCODING"
for file in *.txt; do
$CONVERT "$file" -o "${file%.txt}.utf8.converted"
done
exit 0
@nicolascarrascob
nicolascarrascob / OracleExportClob.sql
Last active September 30, 2020 04:26
Oracle Script to export a CLOB column to a txt file
CREATE DIRECTORY DUMP_SOURCES AS 'C:\temp\';
BEGIN
FOR rec IN (
select id, xml
FROM table
)
LOOP
DBMS_XSLPROCESSOR.clob2file(rec.xml, 'DUMP_SOURCES', rec.id ||'.txt');
END LOOP;
END;
@nicolascarrascob
nicolascarrascob / Laravel Columns Info
Created August 16, 2020 03:14
Laravel Columns Info
private function getColumnsInfo($tableName)
{
try {
$columns = DB::table('information_schema.columns')
->select('column_name')
->where('table_name', $tableName)
->where('column_name', '!=', 'geom')
->get()->toArray();
foreach ($columns as $column) {
$column->data_type = DB::connection()
@nicolascarrascob
nicolascarrascob / composer_path.json
Created May 6, 2020 18:35 — forked from ralder/composer_path.json
Composer Using Local Repositories and Branches
{
"repositories": [
{
"type": "path",
"url": "../relative/project/path"
}
],
"require": {
"${project}": "dev-${branch}"
}