Skip to content

Instantly share code, notes, and snippets.

View allanesquina's full-sized avatar
💭
New horizon!

Allan Esquina allanesquina

💭
New horizon!
View GitHub Profile
// List of pieces
const PIECES_LIST = [
{
id: 1,
size: { col: 6, row: 2 },
length: 1,
},
{
id: 2,
size: { col: 2, row: 2 },
services:
php:
...
links:
- db
db:
...
links:
- php
@allanesquina
allanesquina / create-ssl-cert.sh
Created April 8, 2020 21:48 — forked from ArnaudValensi/create-ssl-cert.sh
Generate a self signed certificate without passphrase for private key
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 10000 -nodes
@allanesquina
allanesquina / init.sh
Created December 19, 2017 13:32
init.sh
sudo apt-get update
sudo apt-get -y install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev libv8-dev libcurl3-dev nodejs ssh libgmp3-dev libmysqlclient-dev libpq-dev libev-dev libgdbm-dev libncurses5-dev automake libtool bison
#git
sudo apt-get install git
#terminator
sudo apt-get install terminator
@allanesquina
allanesquina / prototypal_inheritance.js
Last active December 15, 2016 23:50
A simple example of JavaScript prototypal inheritance
// Person class
function Person(name) {
this.name = name;
}
// Adding getName method to its prototype
Person.prototype.getName = function () {
return this.name;
}
// Creating the matrix;
var matrix = [];
for(var i=0; i<3; i++) {
matrix[i] = [0,0,0];
}
function validate() {
// check result row
var row = matrix.map(function (row) {
@allanesquina
allanesquina / config
Created June 30, 2015 01:59
i3 config file
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
// Object construcion exemple
function MyClass() {
this.myProperty = 'foo';
}
// Whitout new
var myInstance = {};
MyClass.call( myInstance );
console.log( 'without ' + myInstance.myProperty );
@allanesquina
allanesquina / curlftpfs.sh
Created February 21, 2015 19:48
Mount ftp as a drive
mkdir fromftp
sudo curlftpfs -o allow_other ftp://user:pass@hostname /home/fromftp
@allanesquina
allanesquina / scp.sh
Created February 5, 2015 15:18
Example syntax for Secure Copy (scp)
# Single file (-P = ssh port)
sudo scp -P 21 root@server:/var/log/nginx/access.log /home/Downloads/
# Recursive
sudo scp -r -P 21 root@server:/var/log/nginx/ /home/Downloads/