Skip to content

Instantly share code, notes, and snippets.

View nilportugues's full-sized avatar

Nil Portugués Calderó nilportugues

View GitHub Profile

Side nav play

I've never been a big fan of icon-only side navs. So I made a few..

NOTE: I am simply testing interaction. Some of the code is sloppy or impractical. Use with caution.

A Pen by Michael Arestad on CodePen.

License.

@nilportugues
nilportugues / react-lumen.php
Last active December 8, 2018 18:33
React+Lumen
<?php
// bootstrap/react.php
// Remember, we need to do first: composer require react/react!
$app = include('app.php');
$host = 'localhost';
$port = 9000;
$reactApp = function (\React\Http\Request $request, \React\Http\Response $response) use ($app, $host, $port) {
@nilportugues
nilportugues / README.md
Created November 4, 2015 20:35 — forked from smoya/README.md
Get php trace -on segmentation fault- using xdebug
  • Enable the tracer on your xdebug.ini file (see the xdebug.ini file).
  • If you are gonna trace an http request, make sure your xdebug.trace_output_dir is writable by the webserver user (www-data).
  • Execute your script or your request. You can use produce_segmentation.php to test.
  • See the trace file(s) on your xdebug.trace_output_dir.
@nilportugues
nilportugues / id-offuscation concept.php
Created November 23, 2015 23:59
id-offuscation concept.php
<?php
include 'vendor/autoload.php';
//This hash must be a constant (user defined)
$tiny = new \ZackKitzmiller\Tiny('abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ5SX0TEjkR1mLOw8Gvq2VyJxIFhgCAYidrclDWaM3so9bfzZpuUenKtP74QNH6B');
$firstletterSeparator = 'h';
$lastletterSeparator = 'h';
@nilportugues
nilportugues / mysql2sqlite.sh
Created December 25, 2015 21:09 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@nilportugues
nilportugues / GlobalMercator.php
Created February 2, 2016 10:15 — forked from ramunasd/GlobalMercator.php
GlobalMercator.php provides support for converting between latitude and longitude coordinates and a “quadtree” representation that makes it easy to search a database for physically close points.
<?php
/*
GlobalMercator - part of Aggregate Map Tools
Version 1.0
Copyright (c) 2009 The Bivings Group
All rights reserved.
Author: John Bafford
http://www.bivings.com/
http://bafford.com/softare/aggregate-map-tools/
@nilportugues
nilportugues / using-rxjs-instead-of-flux-with-react.md
Created March 18, 2016 01:15 — forked from justinwoo/using-rxjs-instead-of-flux-with-react.md
Using RxJS instead of Flux with React to organize data flow

Reposted from Qiita

For almost a year now, I've been using this "flux" architecture to organize my React applications and to work on other people's projects, and its popularity has grown quite a lot, to the point where it shows up on job listings for React and a lot of people get confused about what it is.

Why I'm tired of using and teaching flux

There are a billion explainations on the internet, so I'll skip explaining the parts. Instead, let's cut to the chase -- the main parts I hate about flux are the Dispatcher and the Store's own updating mechanism.

If you use a setup similar to the examples in facebook/flux, and you use flux.Dispatcher, you probably have this kind of flow:

cd /tmp
# Install depot_tools first (needed for source checkout)
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
# Download v8
fetch v8
cd v8
@nilportugues
nilportugues / api-standards-talk.md
Last active April 7, 2017 19:36
PHP Barcelona talk Idea

The aim of this talk would be API Formats and Standards:

  • List of current API standards
  • GraphQL,Raw JSON, JSONAPI, HAL+JSON, HAL+XML, JSend and JSend-like.
  • Benefits and drawbacks
  • Standard Adoptions
  • Personal experience
    • PHP, Java and Android development.

I don't mind doing it in english or spanish.