Skip to content

Instantly share code, notes, and snippets.

View IgorDePaula's full-sized avatar
😆

Igor C. de Paula IgorDePaula

😆
View GitHub Profile
@IgorDePaula
IgorDePaula / AWSLambdaGenerateKeyPair.go
Created January 28, 2021 03:06 — forked from arrieta/AWSLambdaGenerateKeyPair.go
AWS Lambda Generate Key Pair (Go)
// Sample code used to generate a cryptographic key pair via an AWS Lambda function.
// (C) 2019 Nabla Zero Labs
// MIT License
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
@IgorDePaula
IgorDePaula / Random-string
Created January 20, 2021 03:33 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@IgorDePaula
IgorDePaula / composer.json
Created March 22, 2020 00:08 — forked from andyshinn/composer.json
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@IgorDePaula
IgorDePaula / README.md
Created January 21, 2020 21:47 — forked from curran/README.md
The Iris Dataset

This is the "Iris" dataset. Originally published at UCI Machine Learning Repository: Iris Data Set, this small dataset from 1936 is often used for testing out machine learning algorithms and visualizations (for example, Scatter Plot). Each row of the table represents an iris flower, including its species and dimensions of its botanical parts, sepal and petal, in centimeters.

The HTML page provides the basic code required to load the data and display it on the page (as JSON) using D3.js.

#!/usr/bin/make
include .env
export
.PHONY: help
.DEFAULT_GOAL := help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
@IgorDePaula
IgorDePaula / client.js
Created November 1, 2019 18:28 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@IgorDePaula
IgorDePaula / post-receive.sh
Created July 3, 2019 15:52 — forked from benfrain/post-receive.sh
post-receive hook for multiple branches
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
git --work-tree=./path/under/root/dir/live-site/ checkout -f $branch
echo 'Changes pushed live.'
fi
@IgorDePaula
IgorDePaula / cors.js
Created June 5, 2019 02:08 — forked from balupton/cors.js
Acheiving CORS via a Node HTTP Server
// Create our server
var server;
server = http.createServer(function(req,res){
// Set CORS headers
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Request-Method', '*');
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
res.setHeader('Access-Control-Allow-Headers', '*');
if ( req.method === 'OPTIONS' ) {
res.writeHead(200);
@IgorDePaula
IgorDePaula / gist:150e57719cdd9768096df4ea82e776ea
Created May 30, 2019 01:41 — forked from kosinix/gist:5354637
Get month names using a for loop and PHP date function.
<?php
for($m=1; $m<=12; ++$m){
echo date('F', mktime(0, 0, 0, $m, 1)).'<br>';
}
@IgorDePaula
IgorDePaula / server-git.conf
Created May 27, 2019 20:22 — forked from kierdwyn/server-git.conf
Nginx git smart http protocol (git-http-backend) configuration with basic authentication. Need the support of fcgiwrap.
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# Forked from jeroen@massar.ch - http://jeroen.massar.ch
# Preparation: you need to install and configure fcgiwrap and set it to listen at fcgiwrap.socket.
# An example tutorial: https://www.howtoforge.com/serving-cgi-scripts-with-nginx-on-centos-6.0-p2
# A useful hint: add -f as a parameter to fcgiwrap to redirect the cgi errors to your nginx error log.
server {
listen 80;
server_name git.example.com;