Skip to content

Instantly share code, notes, and snippets.

View dexfs's full-sized avatar
🎯
Focusing on support my children

André Santos dexfs

🎯
Focusing on support my children
View GitHub Profile
Docker Containers
Create an interactive terminal container with a name, an image, and a default command:
Usage: docker create -it --name=<name> <image> <command>
Example: docker create -it --name=foo ubuntu bash
List all running containers:
foreach($arquivos as $arquivo)
{
if(!in_array($arquivo->getFileName(), $excludeNotDir) &&
!in_array($arquivo->getExtension(), $excludeExtension) &&
!$arquivo->isDir())
{
array_push($files, array('arquivo' => $arquivo->getFileName()));
}
}
@dexfs
dexfs / helpScout.php
Created March 8, 2018 01:13
PHP function that determines if a string starts with an upper-case letter A-Z
<?php
function firstLetterIsUpperCase($word){
if(ctype_upper(substr($word, 0, 1))){
return true;
}
return false;
}
@dexfs
dexfs / Ubuntu server setup script (PHP 7.1)
Created December 30, 2017 21:34 — forked from Ravaelles/Ubuntu server setup script (PHP 7.1)
PHP 7.1 + nginx + MongoDB driver for PHP
#!/bin/bash
######################################################
### README ###########################################
######################################################
###
### One-line server install script for Ubuntu.
### Installs Nginx + PHP7.1 + MongoDB for PHP driver.
###
### Removes previous Apache, PHP, nginx installations.
@dexfs
dexfs / projeto.remoto.md
Last active August 11, 2017 21:24
Tenho interesse em projetos que utilizem os itens abaixo.

Tenho disponível, 4h do meu lindo dia. Tenho interesse em projetos que utilizem/apliquem os itens abaixo.

  • Trabalho em equipe
  • Que use alguma metodoligia ágil.
  • TDD
  • Code Review.
  • PHP/Laravel
  • API
# xdebug
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_connect_back=off" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_handler=dbgp" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.profiler_enable=0" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.profiler_output_dir=/var/www/valordireto" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/xdebug.ini \
<?php
date_default_timezone_set('America/Sao_Paulo');
setlocale(LC_TIME, 'pt_BR', 'portuguese');
require __DIR__ . '/vendor/autoload.php';
\Carbon\Carbon::setLocale('pt_BR.UTF8');
$date = \Carbon\Carbon::now();

Keybase proof

I hereby claim:

  • I am dexfs on github.
  • I am dexfs (https://keybase.io/dexfs) on keybase.
  • I have a public key whose fingerprint is FFC9 5E33 D470 C450 4C72 B5D3 F05F FF34 E749 AD34

To claim this, I am signing this object:

[color]
ui = true
[core]
editor = nano
excludesfile = ~/.gitignore
[alias]
aliases = config --get-regexp alias
a = add
br = branch
ca = commit -v -a
@dexfs
dexfs / timestampswithmysql.sql
Last active January 10, 2017 13:06
Working with timestamps on MySQL 5.6
#ADDING
ALTER TABLE table
ADD created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER someFieldYouWant,
ADD updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER created_at;
#CHANGING
/**
I can't do it with ALTER COLUMN, if anyone knows how the better way to do it, just comment
*/
ALTER TABLE table