Skip to content

Instantly share code, notes, and snippets.

View michelmelo's full-sized avatar
🍷
wine

Michel Melo michelmelo

🍷
wine
View GitHub Profile
@michelmelo
michelmelo / JobOpening.php
Created April 13, 2023 09:43 — forked from ricardonolan/JobOpening.php
PHP/Laravel Developer Instructions - candidate must reside in Portugal - DO NOT COMMENT, PLEASE FOLLOW INSTRUCTIONS
<?php
class JobOpening
{
private $key;
private $encryptedJobDetails;
private $jobDetails;
@michelmelo
michelmelo / RefreshApp.php
Created June 2, 2021 13:28 — forked from leonvanrooijen/RefreshApp.php
Laravel GIT pull command to automatically update the application
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Symfony\Component\Process\Process;
class RefreshApp extends Command
{
/**
@michelmelo
michelmelo / convert.php
Created July 20, 2020 13:06
merge mp4 and mp3
$filename_tmp = [];
$filename_tmp[0] = base_path() . "/000.mp4";
$filename_tmp[2] = base_path() . '/audio.mp3';
$ffmpeg = FFMpeg\FFMpeg::create([
'ffmpeg.binaries' => config('pilot.PATH_FFMPEG'),
'ffprobe.binaries' => config('pilot.PATH_FFPROBE'),
]);
$video = $ffmpeg->open($filename_tmp[0]);
$video
@michelmelo
michelmelo / PHPExcel_Basics.md
Created March 16, 2018 15:37 — forked from r-sal/PHPExcel_Basics.md
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

<?php
/**
* gMaps Class
*
* Pega as informações de latitude, longitude e zoom de um endereço usando a API do Google Maps
*
* @author Michel MElo
*/
class gMaps {
private $mapsKey;
@michelmelo
michelmelo / index.php
Created September 12, 2017 09:20
instalação de ipa fora da appstore
<?php
$ipas = glob('*.ipa');
$provisioningProfiles = glob('*.mobileprovision');
$plists = glob('*.plist');
$sr = stristr( $_SERVER['SCRIPT_URI'], '.php' ) === false ?
$_SERVER['SCRIPT_URI'] : dirname($_SERVER['SCRIPT_URI']) . '/';
$provisioningProfile = $sr . $provisioningProfiles[0];
$ipa = $sr . $ipas[0];
@michelmelo
michelmelo / convert.php
Created September 8, 2017 11:16
convert media_id for url
<?php
function instagram_id_to_url($instagram_id){
$url_prefix = "https://www.instagram.com/p/";
$parts = explode('_', $instagram_id);
$instagram_id = $parts[0];
$userid = $parts[1];
$alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
while($instagram_id > 0) {
$remainder = $instagram_id % 64;
@michelmelo
michelmelo / auto-remove-sublime-license-popup
Last active August 11, 2017 16:22 — forked from egel/auto-remove-sublime-license-popup
Auto-remove Sublime's license popup
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sublime_plugin
import subprocess
from time import sleep
import sys
cl = lambda line: subprocess.Popen(line, shell=True, stdout=subprocess.PIPE).communicate()[0].strip()
log = lambda message: sys.stderr.write("Log: %s\n" % message)
extension UIButton{
func addTextSpacing(spacing: CGFloat){
let attributedString = NSMutableAttributedString(string: (self.titleLabel?.text!)!)
attributedString.addAttribute(NSKernAttributeName, value: spacing, range: NSRange(location: 0, length: (self.titleLabel?.text!.characters.count)!))
self.setAttributedTitle(attributedString, for: .normal)
}
}
btnRegister.addTextSpacing(spacing: 4.5)
@michelmelo
michelmelo / gist:e6347bd62eca53d734822863a475f9bf
Created May 19, 2016 09:00 — forked from burakerdem/gist:d8195e6e343aa55ff578
Installing wget on Mac OS X El Capitan 10.11
curl -O http://ftp.gnu.org/gnu/wget/wget-1.17.tar.gz
tar -xzf wget-1.17.tar.gz
cd wget-1.17
./configure --with-ssl=openssl
./configure --with-ssl=openssl --with-libssl-prefix=/usr/local/ssl
make
sudo make install
wget --help
cd .. && rm -rf wget*