Skip to content

Instantly share code, notes, and snippets.

View thiagoeliasr's full-sized avatar
🏠
Working from home

Thiago Elias thiagoeliasr

🏠
Working from home
View GitHub Profile
@mariuskubilius
mariuskubilius / extractTranslationStrings.php
Created January 23, 2019 15:09
Laravel artisan command to extract translation strings from templates and add them into {language}.json file for localization.
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
class extractTranslationStrings extends Command
{
@nulldreams
nulldreams / Estados.vue
Last active June 5, 2024 20:53
VueJS - Select com todos os estados e cidades dinâmicas.
<template>
<b-container class="formulario">
<b-form>
<b-form-group label="Estados">
<b-form-select v-model="estado" :options="estados" class="mb-3"></b-form-select>
</b-form-group>
<b-form-group label="Cidade">
<b-form-select v-model="cidade" :options="cidades" class="mb-3"></b-form-select>
@lmcneel
lmcneel / remove-node-modules.md
Last active November 9, 2024 05:27
How to remove node_modules after they have been added to a repo

How to remove node_modules

Create a .gitignore file

  1. Check for an existing .gitignore file in the project directory
ls -a
@rap2hpoutre
rap2hpoutre / gup-to-webpack.md
Last active November 22, 2023 00:30
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');
@mikaelz
mikaelz / delete-all-woocommerce-products.php
Last active October 28, 2024 04:07
Remove all WooCommerce products from database via SQL
<?php
require dirname(__FILE__).'/wp-blog-header.php';
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')");
@agentgt
agentgt / eclipse-one-dark-like.xml
Last active July 4, 2024 00:53
One Dark Atom Theme for Eclipse for the Eclipse Color Theme plugin
<?xml version="1.0" encoding="utf-8"?>
<colorTheme id="9999" name="One Dark Like" modified="2015-09-01 19:55:49" author="Adam Gent" website="http://snaphop.com">
<searchResultIndication color="#E5C07B" />
<filteredSearchResultIndication color="#E5C07B" />
<occurrenceIndication color="#4B4E55" />
<writeOccurrenceIndication color="#4B4E55" />
<findScope color="#4B4E55" />
<deletionIndication color="#DF5F5F" />
<sourceHoverBackground color="#4B4E55" />
<singleLineComment color="#969896" italic="false" />
@brunomonteiro3
brunomonteiro3 / Taxonomy items list (inside a post)
Created July 15, 2015 21:09
This code will list all the terms from a taxonomy that are associated with a post. Must be inside a loop.
<?
$yourTaxonomySlugHere = get_the_terms($post->ID, 'yourTaxonomySlugHere');
if ($terms) :
foreach ($terms as $term) :
echo $term->name;
endforeach;
endif;
?>
@muhittin
muhittin / strip_tags.js
Created August 15, 2012 09:29
strip_tags for Javascript
var text = '<div class="foo">bar</div>';
text.replace(/(<([^>]+)>)/ig,""); // Returns: bar