Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Andres Guerrero andresmgsl

View GitHub Profile
@andresmgsl
andresmgsl / .htaccess
Created Jul 23, 2018 — forked from julianpoemp/.htaccess
Optimal .htaccess configuration for an Angular 5 App in production
View .htaccess
# place this file in the same folder as your index.html on your server
# make sure to set the right base href attribute in your index.html
# this file ist hosted on GithubGist:
# https://gist.github.com/julianpoemp/bcf277cb56d2420cc53ec630a04a3566
# REDIRECTION
# to index.html to make routing work in production
<IfModule mod_rewrite.c>
RewriteEngine on
View Good-CONTRIBUTING.md-template.md

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
View gist:48314f4391b1bf4ddecbcbb8557287c6
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@andresmgsl
andresmgsl / gist:78d7226602ca09bb828cdc3e4e953a68
Created Jan 27, 2018 — forked from tamoyal/gist:10441108
Create super user and database user in Mongo 2.6
View gist:78d7226602ca09bb828cdc3e4e953a68
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@andresmgsl
andresmgsl / cors.nginxconf
Created Feb 17, 2017 — forked from pauloricardomg/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
View cors.nginxconf
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {
@andresmgsl
andresmgsl / letsencrypt_2016.md
Created Jan 29, 2017 — forked from cecilemuller/letsencrypt_2018.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)
View letsencrypt_2016.md

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

There are two modes when you don't want Certbot to edit your configuration:

  • 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) to renew certificates.

In the following, we're setting up mydomain.com to be served from /var/www/mydomain, and challenges will be served from /var/www/letsencrypt.

View install-zsh.sh
# Source: http://choyan.me/oh-my-zsh-elementaryos/
sudo apt-get update && sudo apt-get install -y curl vim git zsh
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | bash
sudo chsh -s $(which zsh) $(whoami)
View mongoupdate
db.images.find({}).forEach(function(doc){
var regexp = /(.*)\.[^.]+$/;
var thumbName = doc.name.split('.').reverse().slice(1);
db.images.update(
{number:doc.number},
{ $set:
{"path": {
"url" : "assets/images/users/" + doc.username + "/pieces/" + doc.number + "/" + doc.name,
"thumb": "assets/images/users/" + doc.username + "/pieces/" + doc.number + "/" + thumbName + "_thumb.jpg"}
}
View genymotionwithplay.txt
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
View SimpleHTTPServer
python -m SimpleHTTPServer 8000
You can’t perform that action at this time.