Skip to content

Instantly share code, notes, and snippets.

View AlexSJ's full-sized avatar

Alex Sandro Juchem AlexSJ

View GitHub Profile
@AlexSJ
AlexSJ / jogos.php
Last active August 29, 2015 14:02
Jogos da Copa do Mundo FIFA em 6 linhas - PHP (Baseado no script Python 3 do https://gist.github.com/fmasanori/1288160dad16cc473a53)
<?php
foreach(json_decode(file_get_contents("http://worldcup.sfg.io/matches")) as $jogo) {
if ($jogo->status == 'completed') {
echo $jogo->home_team->country . '(' . $jogo->home_team->goals . ') x (' . $jogo->away_team->goals . ')' . $jogo->away_team->country . '<br>';
}
}
@AlexSJ
AlexSJ / Helper.php
Created June 26, 2014 17:08
Helper para remover acentos das strings
<?php
class Helper {
/**
* Remove acentos das strings
*/
public static function removerAcentos($string) {
return strtr($string, array (
'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', 'å' => 'a', 'æ' => 'a',
'ç' => 'c',
@AlexSJ
AlexSJ / git
Created July 10, 2014 18:44
Git
git status
git add
git commit -m "msg"
git pull (trás os arquivos)
git push (envia os arquivos)
@AlexSJ
AlexSJ / phpstorm-vs-sublimetext-shortcuts.md
Created March 11, 2016 11:56 — forked from silasrm/phpstorm-vs-sublimetext-shortcuts.md
Teclas de atalhos do PHPStorm com funções semelhantes ao Sublime Text, e outras interessantes.

#Teclas de atalhos do PHPStorm com funções semelhantes ao Sublime Text, e outras interessantes.

Sublime Text PHPStorm Função
CMD+P CMD+Shift+O Busca por arquivos no projeto
CMD+R CMD+F12 (1) Lista os métodos da classe e outros símbolos
CMD+F CMD+F Busca no arquivo
CMD+Option+F CMD+R Busca e troca os valores no arquivo
CMD+Shift+F CMD+Shift+F Busca, busca e troca e outros em um determinado caminho com várias regras.
CMD+D (2) Option+Up (2) Seleciona palavra
@AlexSJ
AlexSJ / Install-php7.md
Created March 23, 2016 11:19 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
Puxar novas atualizações para o repositório
Se não estiver no master, deve primeiro commitar as alteração no branch atual
git add --all
git commit -m "WIP"
git pull
git push
Ir para o branch master
git checkout master
@AlexSJ
AlexSJ / universal.R
Created April 13, 2016 18:05 — forked from jtrecenti/universal.R
scraper igreja universal
library(httr)
library(rvest)
library(dplyr)
library(stringr)
library(tidyr)
universal_pags <- function() {
universal_pag <- function(pag) {
link <- sprintf('http://www.universal.org/enderecos/busca/brasil/todas/%04d/', pag)
@AlexSJ
AlexSJ / cpf_consulta_api_sus.js
Created December 5, 2016 02:56 — forked from Pompeu/cpf_consulta_api_sus.js
cpf_consulta_api_sus.js
'use strict';
const http = require('http');
const cpf = process.argv[2];
const url = 'http://dabsistemas.saude.gov.br/sistemas/sadab/js/buscar_cpf_dbpessoa.json.php?cpf='
const consult = `${url}${cpf}`;
http.get(consult, res => {
Troca de branch sem dar push/pull
$ git add --all
$ git commit -m "WIP"
pode trocar de branch
Quando voltar para esse branch, se precisar comitar novas alterações no commit antigo, é só fazer
docker run --name postgresql -itd --restart always \
--env 'PG_PASSWORD=senha' \
--env 'DB_NAME=db' \
--env 'PG_TRUST_LOCALNET=true' \
juchem/postgresql:9.6