Skip to content

Instantly share code, notes, and snippets.


Iván Nawrath Castillo inawrath

View GitHub Profile
inawrath / Problem homebrew
Last active Nov 19, 2020
Problem homebrew bigsur
View Problem homebrew
  1. Install Tools Xcode
  2. Run in terminal sudo xcode-select --switch /Library/Developer/CommandLineTools
  3. Profit

Alternative if first solution not working

  1. Download Xcode beta 12.3
  2. Install (double click)
  3. Run in terminal xcode-select --switch /Applications/
  4. Profit
inawrath / open-tab.js
Created Sep 29, 2020
Open Tab in iOS Safari with JavaScript vanilla
View open-tab.js
const loadingPage = `
/*Huge thanks to @tobiasahlin at */
.spinner {
margin: 100px auto 0;
width: 70px;
text-align: center;
.spinner > div {
inawrath /
Created Mar 28, 2020 — forked from jniltinho/
Install PHP 5.5.38 on Ubuntu 16.04 64Bits
### Install PHP 5.5.38 on Ubuntu 16.04 64Bits
apt-get -y install build-essential libxml2-dev libxslt1-dev
apt-get -y install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libxml2-dev
apt-get -y install libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev
apt-get -y install libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev
apt-get -y install libfreetype6-dev libkrb5-dev libpq-dev libicu-dev
inawrath / settings_sublime.json
Created Nov 28, 2018
Permute Unique lines sublime
View settings_sublime.json
{ "keys": ["f8"], "command": "permute_lines", "args": {"operation": "unique"} }
inawrath /
Created Nov 7, 2018
Copy to clipboard in IPython
from IPython.core.magic import register_line_magic
def clip(line):
global_dict = globals()
if not line in global_dict:
value = global_dict[line]
import os
os.system("echo '%s' | pbcopy" % str(value))
del clip
inawrath / index.html
Last active Jul 19, 2018
Example ReactJS
View index.html
<!doctype html>
<meta charset="utf-8">
<title>ESNext Bin Sketch</title>
<!-- put additional styles and scripts here -->
<link href="" rel="stylesheet" type="text/css">
<!-- CSS Reset -->
<link rel="stylesheet" href="">
inawrath / example.js
Created Jun 26, 2018
Multiple request axios
View example.js
.then(axios.spread((googleRes, appleRes) => {
// do something with both responses
inawrath / onblur.jsx
Created Apr 16, 2018 — forked from pstoica/OnBlurComponent.jsx
onBlur for entire react component
View onblur.jsx
var HelloMessage = React.createClass({
render: function() {
return <div tabIndex="1" onBlur={this.onBlur}>
Hello <input type="text" value="wat"/>
onBlur: function(e) {
var currentTarget = e.currentTarget;
View gist:5ac5597d1438a55a91066ce1619fb0d2
Install docker CE ubuntu how sudo
# curl -sSL | sh
inawrath / gist:3341b56a98cd1f349965ff87ac4cd6ab
Created Jun 14, 2017
Enabling URL token validation varnish
View gist:3341b56a98cd1f349965ff87ac4cd6ab
Enabling URL token validation
Last updated December 15, 2016
Token validation allows you to create URLs that expire. Tokens are generated within your web application and appended to URLs in a query string. Requests are authenticated at Fastly's edge instead of your origin server. When Fastly receives a request for the URL, the token is validated before serving the content. After a configurable period of time, the token expires.
Adding custom VCL
To enable token validation, you'll need to create a Varnish configuration named vcl_recv and add the following example code to it.
IMPORTANT: The ability to upload custom VCL code is disabled by default when you sign up. To enable this ability for your account, contact and request it.
/* make sure there is a token */
if (req.url !~ ".+\?.*token=(\d{10,11})_([^&]+)") {