Skip to content

Instantly share code, notes, and snippets.


Hélio insign

Block or report user

Report or block insign

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
garygreen / 2018_02_13_142413_add_renews_at_column_to_subscriptions.php
Last active Sep 23, 2019
Sync Stripe Renewal Date for all subscriptions - Laravel Console Command
View 2018_02_13_142413_add_renews_at_column_to_subscriptions.php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddRenewsAtColumnToSubscriptions extends Migration
* Run the migrations.
View template-refatorado.js
function t(str, data){
const strReplace = (str, key) => str.replace( new RegExp('{'+key+'}','g'), data[key] );
return Object.keys(data).reduce(strReplace, str);
stormwild /
Last active Feb 17, 2019
Composer install shell script
# php -r "copy('', 'composer-setup.php');"
# php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
# php composer-setup.php --install-dir=/usr/local/bin --filename=composer
# php -r "unlink('composer-setup.php');"
php -r "copy('', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"
rap2hpoutre /
Last active Sep 25, 2019
Laravel 5.4: migrate from gulp to webpack
  • Create a webpack.mix.js file in root directory:
const { mix } = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css');
/* Optional: uncomment for bootstrap fonts */
// mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap');
martinbean / pre-commit
Last active May 29, 2019
Pre-commit hook to detect if any .php files contain dd()
View pre-commit
$files = shell_exec('git diff-index --name-only --cached --diff-filter=ACMR HEAD | grep "\.php$"');
$files = explode("\n", trim($files));
$exitCode = 0;
foreach ($files as $file) {
if (empty($file)) {
claudiosanches /
Last active Aug 30, 2016
Ubuntu - Install
#!/usr/bin/env bash
sudo su
curl -SO#
mkdir -p /opt/stremio
tar -xvzf Stremio3.5.1.linux.tar.gz -C /opt/stremio
curl -SO#
mv stremio-white-small.png /opt/stremio/
curl -SO#
mv stremio.desktop /usr/share/applications/
gokulkrishh / media-query.css
Last active Jan 24, 2020
CSS Media Queries for Desktop, Tablet, Mobile.
View media-query.css
##Device = Desktops
##Screen = 1281px to higher resolution desktops
@media (min-width: 1281px) {
telekosmos / uniq.js
Last active Jan 18, 2020
Remove duplicates from js array (ES5/ES6)
View uniq.js
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
hertz1 / removerAcentos.js
Last active Jan 14, 2020
Função simples e eficiente para remover todos os tipos de acentos da língua portuguesa.
View removerAcentos.js
* Remove acentos de strings
* @param {String} string acentuada
* @return {String} string sem acento
var map={"â":"a","Â":"A","à":"a","À":"A","á":"a","Á":"A","ã":"a","Ã":"A","ê":"e","Ê":"E","è":"e","È":"E","é":"e","É":"E","î":"i","Î":"I","ì":"i","Ì":"I","í":"i","Í":"I","õ":"o","Õ":"O","ô":"o","Ô":"O","ò":"o","Ò":"O","ó":"o","Ó":"O","ü":"u","Ü":"U","û":"u","Û":"U","ú":"u","Ú":"U","ù":"u","Ù":"U","ç":"c","Ç":"C"};
function removerAcentos(s){ return s.replace(/[\W\[\] ]/g,function(a){return map[a]||a}) };
barryvdh / .phpstorm.meta.php
Last active Jan 12, 2020
Laravel PhpStorm Meta file
View .phpstorm.meta.php
namespace PHPSTORM_META {
* PhpStorm Meta file, to provide autocomplete information for PhpStorm
* Generated on 2017-09-28.
* @author Barry vd. Heuvel <>
* @see
You can’t perform that action at this time.