Skip to content

Instantly share code, notes, and snippets.

View AlexR1712's full-sized avatar
🏠
Working from home

Alexander J. Rodriguez D. AlexR1712

🏠
Working from home
View GitHub Profile
@AlexR1712
AlexR1712 / curl.php
Created July 27, 2016 06:00
cURL POST
<?php
$ch = curl_init();
$fields =
http_build_query(
[
'dato1' => 2016,
'dato2' => 2017
]
@AlexR1712
AlexR1712 / nginx.conf
Created August 7, 2016 20:42 — forked from o-shabashov/nginx.conf
Nginx 1.10.* + LetsEncrypt SSL (A+) + HTTP/2 + PHP7-FPM + Force HTTPS sample config
server {
listen 80;
server_name domain.com;
root /var/www/domain.com;
location ~ /.well-known {
allow all;
}
location ~ /\.ht {
@AlexR1712
AlexR1712 / file.io.upload.php
Created September 1, 2016 03:04
File.io PHP File Upload up to 5GB
<?php
// Use composer
// composer require guzzlehttp/guzzle:~6.0
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
@AlexR1712
AlexR1712 / head.nodes.js
Created October 5, 2016 02:00
Nodos en el Head HTML
document.head.childNodes
@AlexR1712
AlexR1712 / gotoxy.c
Created October 28, 2016 04:39
Gotoxy in native C
#include<stdio.h>
//gotoxy function
void gotoxy(int x,int y)
{
printf("%c[%d;%df",0x1B,y,x);
}
main ()
{
gotoxy(25,50); //reposition cursor
printf("hello world"); //display text
@AlexR1712
AlexR1712 / bladeCompile.php
Last active December 5, 2022 07:20
Compile a string like Blade Template in Laravel
<?php
// Only you need to add in your controller.
public function bladeCompile($value, array $args = array())
{
$generated = \Blade::compileString($value);
ob_start() and extract($args, EXTR_SKIP);
// We'll include the view contents for parsing within a catcher
// so we can avoid any WSOD errors. If an exception occurs we
@AlexR1712
AlexR1712 / README.md
Created January 20, 2017 20:09 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@AlexR1712
AlexR1712 / quotes.php
Last active January 28, 2017 18:39
Quotes Web Scrapping for http://frasesmotivacion.net/
<?php
function get_http_response_code($url)
{
$headers = get_headers($url);
return substr($headers[0], 9, 3);
}
function getQuotes($page="")
{
try {
# stop script on error signal
set -e
# remove old deployment folders
if [ -d "/home/forge/weather-deploy" ]; then
rm -R /home/forge/weather-deploy
fi
if [ -d "/home/forge/weather-backup" ]; then
rm -R /home/forge/weather-backup
fi

From zero to microservice with 𝚫 now

The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.

It uses Open Source tools that are widely available, tested and understood:

  • Node.JS
  • NPM
  • Express