Skip to content

Instantly share code, notes, and snippets.

View cesc1989's full-sized avatar
🐻
¿Cuál es la diferencia entre la participación y el compromiso?

Francisco Quintero cesc1989

🐻
¿Cuál es la diferencia entre la participación y el compromiso?
View GitHub Profile
@cesc1989
cesc1989 / 001_provision_ubuntu.sh
Last active September 24, 2017 17:24
Get Linux distro in a ready-to-work state with this bash script.
#!/bin/bash
# First things first, update system
echo "Updating system and installing new packages"
sudo apt-get update
sudo apt-get upgrade
# Install basic dependencies and utilities
echo "Install utilities"
sudo apt-get -y install rar unrar zip unzip
@cesc1989
cesc1989 / web-fonts-asset-pipeline.md
Created January 9, 2016 05:14 — forked from anotheruiguy/web-fonts-asset-pipeline.md
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

@cesc1989
cesc1989 / 0.md
Created February 26, 2016 17:15 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@cesc1989
cesc1989 / README.md
Last active October 11, 2017 17:51 — forked from bsodmike/gist:1369419
Subdomain Routing with Rails 3.1

Implement Routing for Subdomains

Rails 3.0 introduced support for routing constrained by subdomains.

A subdomain can be specified explicitly, like this:

match '/' => 'home#index', :constraints => { :subdomain => 'www' } 
@cesc1989
cesc1989 / http_status_codes.rb
Last active February 1, 2017 21:40 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
2xx Success
200 :ok
201 :created
202 :accepted
203 :non_authoritative_information
@cesc1989
cesc1989 / multi-git.md
Last active March 20, 2019 22:04 — forked from rosswd/multi-git-win.md
Setting up a Github and Bitbucket account on the same computer.

Setting up a separate github and bitbucket account on the same computer

Github will be the main account and bitbucket the secondary.

Create SSH Keys

ssh-keygen -t rsa -C "github email"

Save keys to:

~/.ssh/id_rsa

@cesc1989
cesc1989 / ubuntu_unattended_upgrades_gmail.md
Last active March 8, 2017 19:33 — forked from roydq/ubuntu_unattended_upgrades_gmail.markdown
Unattended upgrades on Ubuntu 14.04 with email notifications

Getting Started

Install unattended-upgrades:

$ sudo apt-get update && sudo apt-get install -y unattended-upgrades 

Frequency Configuration

@cesc1989
cesc1989 / sns_to_slack.js
Created September 22, 2017 20:10
Send Code Deploy deployment status to Slack via SNS using a Lambda function
var https = require('https');
var util = require('util');
exports.handler = function(event, context){
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var postData = {
"channel": "#server-deploys",
"username": "AWS SNS via Lambda",
@cesc1989
cesc1989 / deploy-aws-codedeploy.sh
Last active July 28, 2020 19:09
Todos mis scripts personales que uso o dejé de usar.
#!/bin/bash -xe
#
# Deploy latest revision without going to the AWS web console (used for failed deployments)
#
# jq needs to be installed
# https://stedolan.github.io/jq/
aws --region us-west-2 \
deploy list-application-revisions \
--application-name staging \
@cesc1989
cesc1989 / wp-config.php
Created October 11, 2017 17:30
Set WordPress site URL in the config file instead of the database
<?php
// WordPress stores the site URL in the database by default (which I have never
// understood), and it's a pain to have to type out the UPDATE SQL or search in
// phpMyAdmin to change it. This is a simple way to put the URL into
// wp-config.php instead.
// Note that you will still need to update any URLs that appear in the content,
// especially when you copy a database from a development site to production:
// https://gist.github.com/davejamesmiller/a8733a3fbb17e0ff0fb5