Skip to content

Instantly share code, notes, and snippets.

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

André Matias andrematias

🏠
Working from home
View GitHub Profile
@andrematias
andrematias / __upload_file.md
Created March 21, 2022 19:36 — forked from maxivak/__upload_file.md
PHP upload file with curl (multipart/form-data)

We want to upload file to a server with POST HTTP request. We will use curl functions.

// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");

// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");
@andrematias
andrematias / INSTALL.md
Created March 20, 2022 09:58 — forked from takeit/INSTALL.md
Write to NTFS on macOS Sierra (osxfuse + ntfs-3g)
  1. Install osxfuse:
brew cask install osxfuse
  1. Reboot your Mac.

  2. Install ntfs-3g:

@andrematias
andrematias / .git-commit-template
Last active July 28, 2020 20:50 — forked from zakkak/.git-commit-template
This commit message template that helps you write great commit messages and enforce it across your team.
# [<tag>] (If applied, this commit will...) <subject> (Max 72 char)
# |<---- Preferably using up to 50 chars --->|<------------------->|
# Example:
# [feat] Implement automated commit messages
# (Optional) Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# (Optional) Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@andrematias
andrematias / index.html
Created December 19, 2017 23:12 — forked from umidjons/index.html
Upload File using jQuery.ajax() with progress support
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Upload File using jQuery.ajax() with progress support</title>
</head>
<body>
<input type="file" name="file" id="sel-file"/>
server {
# see: http://wiki.nginx.org/Pitfalls
# see: http://wiki.nginx.org/IfIsEvil
listen 80;
root /app;
index index.html index.htm index.php;
error_page 404 /index.php;
# Make site accessible from http://set-ip-address.xip.io
@andrematias
andrematias / git_branch
Created February 22, 2017 15:31 — forked from shivabhusal/git_branch
Add this snippet in Linux (Ubuntu)'s `~/.bashrc` to see your current git-branch in terminal prompt
# Author : Shiva Bhusal
# github: shivabhusal
# stackoverflow: users/3437900/illusionist
##########################################
# Usages:
# - create a file called ~/.promptrc
# - add following in ~/.bashrc
# `source ~/.promptrc`
# # this will include the source of the file
@andrematias
andrematias / commands.php
Created January 31, 2017 13:39 — forked from escopecz/commands.php
Script to run Mautic (https://mautic.org) commands from a URL.
<?php
if (!isset($_GET['ILoveMauticReallyIDo'])) {
echo 'The secret phrase is wrong.';
die;
}
$link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$allowedTasks = array(
'cache:clear',
@andrematias
andrematias / Instalacao_do_oracle_sql_plus.md
Last active October 24, 2016 23:49 — forked from tcnksm/install_sqlplus.md
How to install oracle client to Ubuntu 12.04

Instalação do ORACLE SQL*Plus

  1. Faça o download dos pacotes .rpm Aqui

    • oracle-instantclinet*-basic-*.rpm
    • oracle-instantclinet*-devel-*.rpm
    • oracle-instantclinet*-sqlplus-*.rpm
  2. Instale o conversor de pacotes rpm para deb, alien

    • sudo apt-get install alien
  3. Converta e instale os pacotes com o Alien

@andrematias
andrematias / gist:e223ffc870c1af38ed89f6fdd34fb55b
Created August 17, 2016 20:06 — forked from philfreo/gist:0a4d899de4257e08a000
4 different ways to save a Highcharts chart as a PNG (with and without a server)
// Method 1: simply use Highcharts built-in functionality (SVG -> Highcharts server -> PNG)
// Downside: won't work in webview native apps that don't handle the form response
highcharts.exportChart({
filename: filename
});