Skip to content

Instantly share code, notes, and snippets.

View degt's full-sized avatar
⛱️
Le vent se lève, il faut tenter de vivre.

Daniel Gutiérrez degt

⛱️
Le vent se lève, il faut tenter de vivre.
View GitHub Profile
@degt
degt / convert.js
Last active September 3, 2018 17:31
Convert .VUE files to .js
const compiler = require('vue-template-compiler');
const babel = require("@babel/core");
let content = '';
process.stdin.resume();
process.stdin.on('data', buf => {
content += buf.toString();
});
@degt
degt / gist:56e36dfe40383be29ec2268106793166
Created July 17, 2018 21:05
Build Webcomponents VUE
"build-wc": "vue-cli-service build --target wc --name lib 'src/components/*.vue'"
@degt
degt / spyscroll.js
Created May 24, 2018 23:58
Cambia el fondo de la navegación
$(document).ready(function(){
$(window).scroll(function(evt){
var height = $(window).scrollTop();
if(height > 300) {
$('.navbar').addClass('bg-dark');
}else{
$('.navbar').removeClass('bg-dark');
}
});
@degt
degt / UpgradePHPEB.sh
Created April 3, 2018 14:18
Upgrade PHP version on AWS EB
aws elasticbeanstalk update-environment --solution-stack-name "64bit Amazon Linux 2017.09 v2.6.6 running PHP 7.1" --environment-id "********" --region "us-east-1"
@degt
degt / remove-log.js
Created April 2, 2018 20:14
Remove console.log
console.log = function() {}
@degt
degt / array_in_liquid.html
Created October 13, 2017 15:10
Arrays in Liquid
{% assign words = "Hi, how are you today?" | split: ' ' %}
{% for word in words %}
{{ word }} <br>
{% endfor %}
@degt
degt / seed.md
Last active July 15, 2020 05:04
Running laravel db:seed on Heroku
  1. run "heroku run bash". This creates a one-off-dyno in your heroku app.
  2. run "composer update". now if you check vendor folder you can see fzaninotto/faker package installed.
  3. now run "php artisan db:seed". Your database will be seeded.
@degt
degt / remove-css.js
Created May 2, 2017 19:50
Remove Stylesheet with name 'base*'
//Remove Base css
$('link').each(function(index, ele){
var href = $(ele).attr('href');
var regex = /base/;
if(regex.test(href)){
$(ele).remove();
}
});
@degt
degt / phoneregex.js
Last active February 28, 2017 12:42
9 digits phone validation
var phoneRegex = /^[0-9]{9}$/;
@degt
degt / Liquid.md
Last active February 2, 2017 12:11

#Includes en Liquid

En Liquid podemos crear bloques o ‘Snippets’ dinámicos que permitan modificar el contenido, clases o cualquier contenido según sea necesario.

Por ejemplo una alerta:

Snippet “alerta”