Skip to content

Instantly share code, notes, and snippets.

View nailton's full-sized avatar

Nailton nailton

View GitHub Profile
@calebporzio
calebporzio / pure_html_css_modal.css
Last active February 28, 2022 18:15
The CSS for the pure HTML/CSS modal I tweeted about.
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
@bdpwebdesign
bdpwebdesign / key_mapping.md
Last active July 14, 2024 11:27
Apple Magic Keyboard mapping for Linux Mint

Map an Apple Magic Keyboard to a Linux machine

Configured for a Mac-like experience

Apple Magic Keyboard 2: Model A1644 (same as MLA22LL/A ?)

Mapping for Linux Mint 18 Cinnamon 64-bit

xmodmap source

@rafaelstz
rafaelstz / get.js
Last active October 6, 2023 14:35
AJAX GET and POST with pure Javascript
// Exemplo de requisição GET
var ajax = new XMLHttpRequest();
// Seta tipo de requisição e URL com os parâmetros
ajax.open("GET", "minha-url-api.com/?name=Henry&lastname=Ford", true);
// Envia a requisição
ajax.send();
// Cria um evento para receber o retorno.
@themsaid
themsaid / gist:92dc313ffda506f0f0f3f295ed66a64b
Last active May 2, 2018 14:44
Delete all branches except
// Delete all except multiple
git branch | grep -v "master\|dev" | xargs git branch -D
// Delete all except 1
git branch | grep -v "master" | xargs git branch -D
@adamwathan
adamwathan / belongs-to-many.sublime-snippet
Last active October 19, 2020 16:59
Eloquent Relationship snippets for Sublime Text
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->belongsToMany(${1/^(.+)$/(?1\u$1:)/g}::class, {$2:table});
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>belt</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<?php
// Get Base URI
$baseUri = str_replace($_SERVER['DOCUMENT_ROOT'], '', dirname($_SERVER['SCRIPT_FILENAME']));
$http = str_replace(array('/', '\\'), '/', $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . $baseUri . '/');
$catalog = explode('/', $http);
array_pop($catalog);
array_pop($catalog);
$catalog = implode('/', $catalog) . '/';
@claudiosanches
claudiosanches / test.php
Last active February 22, 2024 19:39
Regex for test credit card brand
<?php
// Test cards
$cards = array(
'378282246310005', // American Express
'371449635398431', // American Express
'5078601870000127985', // Aura
'5078601800003247449', // Aura
'30569309025904', // Diners Club
'38520000023237', // Diners Club
@petehouston
petehouston / sync.sh
Created February 19, 2015 06:52
Little script to sync the project/public/ and www/ directory for Laravel 5 deployment
#!/bin/sh
mv www/index.php index.php.saved
rm -rf www/*
# update project/ to your directory name
cp -a project/public/* www
cp project/public/.* www
rm -rf www/index.php
mv index.php.saved www/index.php
@petehouston
petehouston / gulpfile.js
Last active February 23, 2017 06:49
Laravel Elixir extension to files/folders remove
// require: $ npm install --save-dev del
var gulp = require('gulp');
var elixir = require('laravel-elixir');
var del = require('del');
elixir.extend("remove", function(path) {
gulp.task("remove", function() {
del(path);
});
@ericlbarnes
ericlbarnes / .bowerrc
Created January 17, 2015 03:33
Laravel Elixir With Bootstrap Sass
{
"directory": "vendor/bower_components"
}