Skip to content

Instantly share code, notes, and snippets.

View matheuseduardo's full-sized avatar
:octocat:
coding

Matheus Eduardo Silva Guimarães matheuseduardo

:octocat:
coding
View GitHub Profile
@matheuseduardo
matheuseduardo / httpd-aliases.conf
Last active June 7, 2017 21:24
alias to another folder outside xampp location (windows)
Alias /aliasname "D:/Path/to/folder/foldername"
<directory "D:/Path/to/folder/foldername">
Options Indexes FollowSymLinks Includes ExecCGI MultiViews
AllowOverride All
Allow from all
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.counter span {
float:left;
width:22px;
Verifying that "matheuseduardo.id" is my Blockstack ID. https://onename.com/matheuseduardo
@matheuseduardo
matheuseduardo / media-profile-hevc.xml
Last active January 19, 2018 18:49
file to be saved @ /system/etc - oneplus 5
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
Copyright (C) 2012-2016 The Linux Foundation. All rights reserved.
Not a contribution.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
html,
body {
font-family: Helvetica, Arial, sans-serif;
@matheuseduardo
matheuseduardo / cakephp-last-executed-query
Last active June 5, 2018 18:44 — forked from mikedamoiseau/cakephp-last-executed-query
CakePHP - Display last executed SQL query
// only for CakePHP 2.x
$lastquery = end($this->getDatasource()->getLog()['log'])['query'];
debug($lastquery);
@matheuseduardo
matheuseduardo / adb.sh
Created August 14, 2016 04:37
android adb commands
# Toggle Airplane Mode
# http://stackoverflow.com/questions/10506591/turning-airplane-mode-on-via-adb
am start -a android.settings.AIRPLANE_MODE_SETTINGS && input keyevent 19 && input keyevent 23 && input keyevent 4
# Turn on:
adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
@matheuseduardo
matheuseduardo / adicionar-dias-uteis.php
Created June 26, 2018 19:10
função para adicionar determinado dias úteis - #php
<?php
function adicionaDiasUteis(int $numDias=0, DateTime $data):DateTime {
$dataFim = clone $data;
$umdia = new DateInterval('P1D'); // intervalo fixo
for ($i=0; $i<$numDias; $i++) {
$dataFim->add($umdia);
if ($dataFim->format('w') == "0" || $dataFim->format('w') == "6") {
$i--; // retorna o contador, caso seja sábado ou domingo
}
@matheuseduardo
matheuseduardo / Cake Composer.md
Created July 9, 2018 14:03 — forked from ogrrd/Cake Composer.md
Install Cake 2.x with Composer

Install CakePHP 2.x with Composer

Remove the main CakePHP lib directory

$ cd /path/to/your/website
$ rm -Rf ./lib

Add the following composer.json file

@matheuseduardo
matheuseduardo / create-preview-from-video.sh
Created July 18, 2018 16:04
Create Short Preview from Video
# source: https://davidwalsh.name/video-preview
# sample in PHP => https://gist.github.com/AkgunFatih/88c2241865c25e40a50edc4e24679a94
sourcefile=$1
destfile=$2
# Overly simple validation
if [ ! -e "$sourcefile" ]; then
echo 'Please provide an existing input file.'