Skip to content

Instantly share code, notes, and snippets.

View diegofelix's full-sized avatar

Diego Felix diegofelix

View GitHub Profile
@diegofelix
diegofelix / Free O'Reilly Books.md
Created August 9, 2019 16:29 — forked from augbog/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@diegofelix
diegofelix / shippment_cost.php
Created February 20, 2018 12:05
Calculate Shipment Cost on Correios
<?php
$client = new SoapClient('http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx?WSDL');
try {
var_dump($client->__getFunctions());
var_dump($client->__getTypes());
$resposta = $client->CalcPrazo([
'nCdServico' => '40010', // Sedex
'sCepOrigem' => '12235360', // CEP Origem
'sCepDestino' => '04690000', // Cep Destino
@diegofelix
diegofelix / cep_consult.php
Created February 20, 2018 12:04
Find Postal Code From Correios
<?php
$client = new SoapClient("https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl");
try {
var_dump($client->__getFunctions());
var_dump($client->__getTypes());
$resposta = $client->consultaCEP([
'cep' => '08220000',
]);
var_dump($resposta);
} catch (SoapFault $e) {
@diegofelix
diegofelix / .bash_aliases
Created December 26, 2017 12:38
Run phpunit on the last modified test file. (Using Docker)
# Last Modified Test File
alias lastModifiedTestFile="(find tests -type f -printf '%T@ %p\n' | sort -k1,1nr | head -1 | grep -oE '[^ ]+$')"
# this function get the last modified file that are inside the `tests` folder
# and run the phpunit.
function phpunit() {
echo "Testing $(lastModifiedTestFile)...";
dctest $(lastModifiedTestFile);
}
@diegofelix
diegofelix / sublime-packages.txt
Last active February 20, 2018 12:06
sublime-packages.txt
advanced new file
bracketHighlighter
docblockr
dotEnv
emmet
expand tabs on save
gist
html-css-js prettyfy
blade highlighter
material theme
@diegofelix
diegofelix / center.css
Created July 18, 2016 17:44
center something vertically
/* This parent can be any width and height */
.block {
text-align: center;
height: 100px;
/* May want to do this if there is risk the container may be narrower than the element inside */
white-space: nowrap;
}
/* The ghost, nudged to maintain perfect centering */
.block:before {
@diegofelix
diegofelix / NiceSelect.sass
Last active July 8, 2016 15:48
Nice Select Combo Box
// <div class="NiceSelect NiceSelect--focus">
// <span class="NiceSelect__text">Option Selected</span>
// <select>
// <option value="1">Option Selected</option>
// <option value="2">Other Option</option>
// </select>
// </div>
.NiceSelect
width: 100%
position: relative
@diegofelix
diegofelix / Keygen.php
Created June 30, 2016 18:55
Keygen.php
<?php
namespace App\Services;
class Keygen {
/**
* Removed zeroes and o's to avoid missreading
*
* @var string
@diegofelix
diegofelix / grid.styl
Last active May 24, 2016 17:40
Simple 12 Grid Column
.grid
clear both
padding 0px
margin 0px
display block
zoom 1 /* For IE 6/7 */
.grid:before,
.grid:after
content ""
@diegofelix
diegofelix / Preferences.sublime-settings
Last active August 8, 2016 14:54
My Sublime Preferences
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"caret_extra_width": 2,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"font_face": "Operator Mono",
"font_options":
[
"gray_antialias",
"subpixel_antialias"