Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Hélio insign

🎯
Focusing
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
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
<?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
stormwild / composer-install.sh
Last active Feb 17, 2019
Composer install shell script
View composer-install.sh
# php -r "copy('https://getcomposer.org/installer', '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('https://getcomposer.org/installer', '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
rap2hpoutre / gup-to-webpack.md
Last active Sep 25, 2019
Laravel 5.4: migrate from gulp to webpack
View gup-to-webpack.md
  • 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
martinbean / pre-commit
Last active May 29, 2019
Pre-commit hook to detect if any .php files contain dd()
View pre-commit
#!/usr/bin/php
<?php
$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
claudiosanches / install.sh
Last active Aug 30, 2016
Ubuntu - Install Strem.io
View install.sh
#!/usr/bin/env bash
sudo su
curl -SO# http://178.62.254.47/Stremio3.5.1.linux.tar.gz
mkdir -p /opt/stremio
tar -xvzf Stremio3.5.1.linux.tar.gz -C /opt/stremio
curl -SO# http://www.strem.io/3.0/stremio-white-small.png
mv stremio-white-small.png /opt/stremio/
curl -SO# https://gist.githubusercontent.com/claudiosmweb/797b502bc095dabee606/raw/52ad06b73d90a4ef389a384fbc815066c89798eb/stremio.desktop
mv stremio.desktop /usr/share/applications/
@gokulkrishh
gokulkrishh / media-query.css
Last active Nov 13, 2019
CSS Media Queries for Desktop, Tablet, Mobile.
View media-query.css
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@telekosmos
telekosmos / uniq.js
Last active Nov 7, 2019
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
hertz1 / removerAcentos.js
Last active Oct 14, 2019
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
barryvdh / .phpstorm.meta.php
Last active Sep 3, 2019
Laravel PhpStorm Meta file
View .phpstorm.meta.php
<?php
namespace PHPSTORM_META {
/**
* PhpStorm Meta file, to provide autocomplete information for PhpStorm
* Generated on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
You can’t perform that action at this time.