Skip to content

Instantly share code, notes, and snippets.


Patricio López Juri lopezjurip

View GitHub Profile
lopezjurip /
Created Sep 25, 2016
Github full code review
# Create empty branch.
git checkout --orphan review
git rm -rf .
git commit --allow-empty -m "Create empty branch"
git push --set-upstream origin review
# Create `project` branch from `master` current state.
git checkout -b project
git merge master --allow-unrelated-histories
git push --set-upstream origin project
lopezjurip / .vscode extensions.json
Last active Nov 10, 2022
Easy Rome Tools setup
View .vscode extensions.json
"recommendations": [
lopezjurip / App.tsx
Created Dec 30, 2020
React useReducer useContext with Typescript types
View App.tsx
import React, { useReducer, useContext, Dispatch } from "react";
import "./styles.css";
// Local types, example: box, product, venue, etc
type MyItem = {
id: number;
name: string;
// Reducer types
lopezjurip /
Last active Jul 15, 2022
Write to NTFS on OSX Yosemite and El Capitan

OUTDATED, see comments below

Install Homebrew:

ruby -e "$(curl -fsSL"

Update Homebrew formulae:

brew update
lopezjurip / Caddyfile
Last active Mar 1, 2022
Fix Too Many Redirect error using Caddy + Cloudflare
View Caddyfile, {
proxy / webapp:3000 {
proxy_header Host {host}
proxy_header X-Real-IP {remote}
proxy_header X-Forwarded-Proto {scheme}
lopezjurip /
Last active Oct 13, 2021
Install Chocolatey on Windows 10 | Install git and Python3 (with pip)

Install Chocolatey on Windows 10

First, you have to run Powershell as administrator. Then type the following:

Set-ExecutionPolicy Unrestricted

Accept to continue.

Then we install Chocolatey:

lopezjurip / gist:cd92f879bc92af698f85ad0433a953cd
Created Mar 29, 2021
Migrate Postgres string field to integer if present else null
View gist:cd92f879bc92af698f85ad0433a953cd
ALTER TABLE "public"."usage_stats"
ALTER COLUMN "resSize" TYPE INT USING CASE WHEN "resSize" ~ '^[-+0-9]+$' THEN "resSize"::integer ELSE NULL END;
lopezjurip / CSharp.sublime-build
Created May 30, 2015
Sublime Text 3 - C# Build System
View CSharp.sublime-build
"shell": true,
"cmd": ["mcs $file ; mono $file_base_name.exe"],
"selector": "source.cs"
lopezjurip / gist:c509eadf1e31b45825a9
Created Feb 10, 2015
Create Doorkeeper authorization via rails console
View gist:c509eadf1e31b45825a9
app = Doorkeeper::Application.create!(:name => 'myapp', :redirect_uri => 'myapp://oauth/callback')
lopezjurip / gist:a817e96ec833e7667274
Last active Jun 9, 2020
View gist:a817e96ec833e7667274
# Based on:
# Add to gemfile:
ruby '2.1.2'
gem 'pg'
gem 'puma'
gem 'rails_12factor'
gem 'searchkick'
gem 'typhoeus'