Skip to content

Instantly share code, notes, and snippets.

View mmolucio's full-sized avatar
🎯
Focusing

Guillermo Lucio mmolucio

🎯
Focusing
View GitHub Profile
@mmolucio
mmolucio / README.md
Created February 11, 2019 22:02 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@mmolucio
mmolucio / gh-dl-release
Created February 6, 2019 23:46 — forked from deevus/gh-dl-release
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@mmolucio
mmolucio / GitHub curl.sh
Created February 6, 2019 17:30 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"

Keybase proof

I hereby claim:

  • I am mmolucio on github.
  • I am memolucio (https://keybase.io/memolucio) on keybase.
  • I have a public key ASC6OmeXCTsp-ej99MKkM5ASAXbOgNzwleUHiuyerckndAo

To claim this, I am signing this object:

@mmolucio
mmolucio / ShouldNotUpdate.js
Created January 28, 2019 01:31 — forked from NoamELB/ShouldNotUpdate.js
component that should not update
class ShouldNotUpdate extends React.Component {
constructor(props) {
super(props);
this.counter = 0;
}
shouldComponentUpdate(nextProps, nextState) {
return this.props.children !== nextProps.children;
}
@mmolucio
mmolucio / delete-git-recursively.sh
Created July 16, 2018 01:00 — forked from facelordgists/delete-git-recursively.sh
Recursively remove .git folders
( find . -type d -name ".git" && find . -name ".gitignore" && find . -name ".gitmodules" ) | xargs rm -rf
@mmolucio
mmolucio / matrix-synapse.conf
Created September 27, 2017 14:03 — forked from Tristor/matrix-synapse.conf
Nginx reverse-proxy config for Matrix Synapse server
server {
listen 80;
listen [::]:80;
server_name matrix.tristor.ro;
location '/.well-known/acme-challenge' {
default_type "text/plain";
allow all;
root /var/www/matrix.tristor.ro/public/;
}
@mmolucio
mmolucio / letsencrypt_2017.md
Last active September 7, 2017 17:12 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.