Skip to content

Instantly share code, notes, and snippets.

View vigoritodcx's full-sized avatar
🦍
ipsum!

vigoritodcx vigoritodcx

🦍
ipsum!
View GitHub Profile
@vigoritodcx
vigoritodcx / Gruntfile.js
Last active July 15, 2019 10:12 — forked from amit-y/Gruntfile.js
Grunt task to search and replace strings in file
module.exports = function(grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Project configuration.
grunt.initConfig({
@vigoritodcx
vigoritodcx / Gruntfile.js
Created July 4, 2018 08:14
grunt cambe functions
grunt.registerTask ( "cambe", "cambe routines handler", function ( action, type, name, variation ) {
function getFileList(type, name, variation) {
var cleanType, cleanName, cleanVariation, folder, file,
fileList = [],
cambe_valids = ["context","area","module","block","element"],
cambe_ext = ["php", "js", "scss"],
regex = "/[`~!@#£$%^&*()_|+\\-=÷¿?;:'\",.<>\\{\\}\\[\\]\\\\\\/]+/gi";
cleanName = ( typeof name === "string" ) ? name.replace ( regex, "_" ) : null;
cleanType = ( typeof type === "string" ) ? type.replace ( regex, "_" ) : null;