Skip to content

Instantly share code, notes, and snippets.

View thallisphp's full-sized avatar
⚒️
Developing with Laravel for Doc88

Thallis Ferreira Soares Casemiro thallisphp

⚒️
Developing with Laravel for Doc88
  • Doc88
  • São Paulo
View GitHub Profile
@ryankirkman
ryankirkman / merge.md
Created August 26, 2011 04:10
the 'perfect' web.config starting point - rpk
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
@guisehn
guisehn / gist:3276302
Last active June 27, 2024 01:40
Validar CNPJ (PHP)
<?php
function validar_cnpj($cnpj)
{
$cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj);
// Valida tamanho
if (strlen($cnpj) != 14)
return false;
@thallisphp
thallisphp / Meses e Dias - Array.php
Last active September 21, 2023 15:45
Array com nomes dos meses e dias da semana em português do Brasil
<?php
$meses = array(
1 => 'Janeiro',
'Fevereiro',
'Março',
'Abril',
'Maio',
'Junho',
'Julho',
@thallisphp
thallisphp / mixins.less
Last active December 22, 2015 09:18
Less Mixins
//noinspection CssUnknownProperty
.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
background: @color;
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, @start), color-stop(1, @stop));
background: -ms-linear-gradient(bottom, @start, @stop);
background: -moz-linear-gradient(center bottom, @start 0%, @stop 100%);
background: -o-linear-gradient(@stop, @start);
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@stop,@start));
}
@dr-dimitru
dr-dimitru / .htaccess
Created October 30, 2013 16:34
.htaccess file for Laravel 4 and Laravel 3 | For /public folder
# ----------------------------------------------------------------------
# /PUBLIC folder .htaccess
# ----------------------------------------------------------------------
# This .htaccess file is recommended
# to be placed at root/public folder
# of your Laravel powered application
# ----------------------------------------------------------------------
# This file works with Laravel 3 and 4
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and
@lpirola
lpirola / lista-de-nacionalidade.txt
Created November 4, 2013 22:12
Lista de países em português com suas respectivas nacionalidades
Antígua e Barbuda - Antiguano
Argentina - Argentino
Bahamas - Bahamense
Barbados - Barbadiano, barbadense
Belize - Belizenho
Bolívia - Boliviano
Brasil - Brasileiro
Chile - Chileno
Colômbia - Colombiano
Costa Rica - Costarriquenho
@Splaktar
Splaktar / app.css
Created May 16, 2014 01:01
AngularJS Animations (ng-enter, ng-leave, fade, slide) in a ng-repeat div
.fade {
transition:0.5s linear all;
}
.fade.ng-enter-stagger,
.fade.ng-leave-stagger {
transiton-delay:0.1s;
transition-duration:0s;
}
.fade.ng-enter {
opacity:0;
@JamsMendez
JamsMendez / ngUploadDrop.js
Created August 12, 2014 05:00
Directiva de Angular.js para subir archivos Drag on Drop
directives.uploadDrop = function (){
return {
require: '?ngModel',
restrict: 'E',
template: '<div class="input-file" style="width: 150px;"><span class="glyphicon glyphicon-picture"></span></div>',
link: function (scope, element, attrs, ngModel){
if (!ngModel) return;
element.bind('drop', function (event) {
@spaze
spaze / opera-vpn.md
Last active April 20, 2024 02:14
Opera VPN behind the curtains is just a proxy, here's how it works

2023 update

ℹ️ Please note this research is from 2016 when Opera has first added their browser "VPN", even before the "Chinese deal" was closed. They have since introduced some real VPN apps but this below is not about them.

🕵️ Some folks also like to use this article to show a proof that the Opera browser is a spyware or that Opera sells all your data to 3rd parties or something like that. This article here doesn't say anything like that.


When setting up (that's immediately when user enables it in settings) Opera VPN sends few API requests to https://api.surfeasy.com to obtain credentials and proxy IPs, see below, also see The Oprah Proxy.

The browser then talks to a proxy de0.opera-proxy.net (when VPN location is set to Germany), it's IP address can only be resolved from within Opera when VPN is on, it's 185.108.219.42 (or similar, see below). It's an HTTP/S proxy which requires auth.

@jhoff
jhoff / README.md
Last active April 1, 2024 07:45
Bash-only Laravel Artisan tab auto-complete

If you are an Oh-my-zsh user, see the Laravel 5 plugin

For the rest of us Bash users, all of the Laravel Artisan autocomplete solutions out there require installing a composer package to get a list of artisan commands. Turns out this isn't really necessary. Simply add the provided code in ~/.bash_profile ( or similarly sourced file ) and you'll get artisan command tab completes on any project on your system.

_artisan()
{
	COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
	COMMANDS=`php artisan --raw --no-ansi list | sed "s/[[:space:]].*//g"`
	COMPREPLY=(`compgen -W "$COMMANDS" -- "${COMP_WORDS[COMP_CWORD]}"`)