Skip to content

Instantly share code, notes, and snippets.

View luissquall's full-sized avatar

Luis Ramos luissquall

View GitHub Profile
@luissquall
luissquall / workshop-environment.sh
Created October 15, 2014 18:46
Workshop environment
mkdir stream-adventure && cd $_
git init
stream-adventure list | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | xargs -I {} sh -c 'mkdir {}; touch {}/program.js'
@luissquall
luissquall / .htaccess
Last active November 10, 2016 22:56
Redirect HTTP traffic to HTTPS
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L]
</IfModule>
<?php
/**
* dump.php?output=1
*
* Usage: curl http://domain.com/dump.php > dump.sql
*/
$bin = PHP_OS == 'Darwin' ? '/usr/local/mysql/bin/mysqldump' : '/usr/bin/mysqldump';
$user = 'root';
$password = '';
$db = 'cenotes';
@luissquall
luissquall / main-colors.md
Last active August 28, 2015 18:08
Extract main colors from Google's Material design color palette
  1. Go to Material design Color page: https://www.google.com/design/spec/style/color.html#
  2. Open the JavaScript Console
  3. Execute this script:
var colors=[];$('.color.main-color').each(function(index, el) {colors.push($(el).find('.hex').text())});copy(colors);
  1. The colors are in your clipboard's buffer!
Verifying that +mono is my blockchain ID. https://onename.com/mono
@luissquall
luissquall / .msmtprc
Created January 28, 2016 23:19
msmtp user configuration file
# Set default values for all following accounts.
defaults
# Always use TLS.
tls on
# Set a list of trusted CAs for TLS. You can use a system-wide default file,
# as in this example, or download the root certificate of your CA and use that.
tls_trust_file ~/etc/ssl/certs/cacert.pem
<?php
/*
echo Tiago > monos
zip --password 1234 monos.zip monos
#unzip -P 1234 monos.zip -d unzipped
chgrp www .
chmod g+w .
*/
$bin = shell_exec('which unzip');
server {
listen 80;
listen [::]:80;
server_name {{ hostname }};
client_max_body_size 10M;
root /var/www/{{ hostname }};
index index.php index.html index.htm;
server {
listen 80;
listen [::]:80;
server_name {{ domain }};
client_max_body_size 10M;
root {{ webroot }};
index index.php index.html index.htm;
server {
listen 80;
listen [::]:80;
server_name www.{{ domain }};
return 301 http://{{ domain }}$request_uri;
access_log /var/log/nginx/www.{{ domain }}.access.log;
error_log /var/log/nginx/www.{{ domain }}.error.log;
}