Skip to content

Instantly share code, notes, and snippets.

View W3SS's full-sized avatar
🎯
Focusing

Wendel G. Santana W3SS

🎯
Focusing
View GitHub Profile
@W3SS
W3SS / data-toggle.coffee
Created June 29, 2017 18:46 — forked from suweller/data-toggle.coffee
Show or hide elements in a form using data-show or data-hide
class window.DataToggle
get: (str) ->
$("##{str}")
ids: (type, e) ->
$(e).attr("data-#{type}").split(' ')
constructor: ->
_self = @
_self.data_show(_self, $(e).parent()) for e in $('[data-show]')
_self.data_hide(_self, $(e).parent()) for e in $('[data-hide]')
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@W3SS
W3SS / js-observables-binding.md
Created October 10, 2017 16:45 — forked from austinhyde/js-observables-binding.md
Vanilla JavaScript Data Binding

Observables

You don't really need a framework or fancy cutting-edge JavaScript features to do two-way data binding. Let's start basic - first and foremost, you need a way to tell when data changes. Traditionally, this is done via an Observer pattern, but a full-blown implementation of that is a little clunky for nice, lightweight JavaScript. So, if native getters/setters are out, the only mechanism we have are accessors:

var n = 5;
function getN() { return n; }
function setN(newN) { n = newN; }

console.log(getN()); // 5

setN(10);

/**
* Define Post Type labels.
*
* @return array Post Type labels.
*/
protected function labels() {
$default = array(
'name' => sprintf( __( '%ss', 'odin' ), $this->name ),
'singular_name' => sprintf( __( '%s', 'odin' ), $this->name ),
'view_item' => sprintf( __( 'View %s', 'odin' ), $this->name ),
@W3SS
W3SS / estados.php
Created October 11, 2017 17:49 — forked from ricardobarantini/estados.php
Array com nome e siglas de estados Brasileiros para select do Codeigniter
$estadosBrasileiros = array(
'AC'=>'Acre',
'AL'=>'Alagoas',
'AP'=>'Amapá',
'AM'=>'Amazonas',
'BA'=>'Bahia',
'CE'=>'Ceará',
'DF'=>'Distrito Federal',
'ES'=>'Espírito Santo',
'GO'=>'Goiás',
@W3SS
W3SS / RemessasController.php
Created October 11, 2017 17:49 — forked from ricardobarantini/RemessasController.php
Gerando lote de remessas com o package \Eduardokum\LaravelBoleto
<?php
/**
* Gera o arquivo de remessa.
*
* @var date $data_inicio
* @var date $data_termino
* @var int $bancos_id
* @return void
*/
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"font_face": "Roboto Mono",
"font_options":
[
"gray_antialias",
"subpixel_antialias"
],
<?php
namespace App\Http\Controllers;
use App\Models\Banco;
use App\Models\Empresa;
use App\Models\Parcelas;
use Carbon\Carbon;
use Illuminate\Http\Request;
@W3SS
W3SS / .htaccess
Created October 11, 2017 17:52 — forked from ricardobarantini/.htaccess
Htaccess para carregar o conteúdo da pasta public em hosts de revenda
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
@W3SS
W3SS / Model.php
Created October 11, 2017 17:53 — forked from ricardobarantini/Model.php
Modifica o formato da data usando Carbon no Laravel
<?php
public function setDataAttribute($value)
{
$this->attributes['data'] = Carbon::createFromFormat('d/m/Y', $value)->toDateString();
}
public function getDataAttribute($value)
{
return Carbon::parse($value)->format('d/m/Y');