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 / 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:

@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)
@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*
@michelmelo
michelmelo / Ti.Geolocation Example
Created September 30, 2015 16:01 — forked from shouse/Ti.Geolocation.Example.js
Ti.Geolocation Example
if (Ti.Geolocation.locationServicesEnabled) {
Titanium.Geolocation.purpose = 'Get Current Location';
Titanium.Geolocation.getCurrentPosition(function(e) {
if (e.error) {
Ti.API.error('Error: ' + e.error);
} else {
Ti.API.info(e.coords);
}
});
} else {
function get_remote_file(filename, url, fn_end, fn_progress ) {
Ti.API.info("[filename]" + filename);
Ti.API.info("[url]" + url);
var file_obj = {file:filename, url:url, path: null};
var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,filename);
if ( !file.exists() ) {
// load sound from remote url
Ti.API.log(item.value.value1); // While the crash occurs, this contains 'http://stadtfestradio.argovia.ch/live'
var streamer = Ti.Media.createAudioPlayer({url:item.value.value1, bufferSize: 4096});
var isPlaying = false;
var container = Ti.UI.createView(api.combine($$.ContentChildView, {top:topMargin}));
parent.add(container);
var stack = Ti.UI.createView({
left: 65,
layout: 'vertical',
width:Ti.UI.SIZE,
var win = Ti.UI.currentWindow;
// Set the window orientation modes for the video to rotate with the device
win.orientationModes = [ Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT,
Ti.UI.LANDSCAPE_RIGHT ];
// Build the movie URL. 'fs' and 'autoplay' parameters are optional.
var movieId = "d0llSyfgwEE";
var movieUrl = "http://www.youtube.com/embed/" + movieId+ "?fs=1&autoplay=1";
/**
* Filename: Call.js
* Author: Codeboxed
* URL: http://www.codeboxed.com
* Date: March 26, 2011
* Platform: Titanium
*/
/**
* Call