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 / website-migration
Last active August 29, 2015 14:14
Bash script to migrate/update Drupal website from development environment to production
#!/bin/bash
# ESTE ARCHIVO TIENE POR PROPOSITO FACILITAR LA MIGRACION DE UN SITIO EN LOCAL
# A UN SITIO ANDANDO EN LINODE. SOLO PARA EL CASO DE ACTUALIZACIONES
#DECLARACIÓN DE VARIABLES NECESARIAS
greentext="\033[32m"
bold="\033[1m"
normal="\033[0m"
bkpdate=$(date +"%Y%m%d%s")
@cesc1989
cesc1989 / .htaccess
Created May 26, 2015 14:56
Configuración del .htaccess para los Permalinks en WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
@cesc1989
cesc1989 / Vagrantfile
Last active January 29, 2016 19:32
Provisioning Dev Stack. Provision a normal Linux machine or a Vagrant Ubuntu-based box.
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.network 'forwarded_port', guest: 3000, host: 3000
config.vm.provision 'shell', path: 'install_software.sh'
@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 / bye_double.sh
Last active January 9, 2017 19:00
Find command to delete AppleDouble files and .DS_Store files
#!/bin/bash
find /path/to/folder -depth -name ".DS_Store" -exec rm {} \;
find /path/to/folder -depth -name "._*" -exec rm -Rf {} \;
@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 / 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 / apache_subdomain.conf
Last active April 5, 2017 03:05
Correctly setup subdomain in apache conf file
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin user@mail.com
ServerName sub.domain.com
ServerAlias www.sub.domain.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/subdomainfolder/public_html
# Log file locations
@cesc1989
cesc1989 / connect_to_database_and_query.php
Last active April 5, 2017 03:05
conect to a database and query it to return data in json format
<?php
$numero_cedula = $_GET['cedula'];
//CONEXION A LA BASE DE DATOS
$username = "root";
$password = "root";
$hostname = "localhost";
@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",