Skip to content

Instantly share code, notes, and snippets.

@shaosh
shaosh / Gruntfile.js
Created November 18, 2015 18:57
Gruntfile.js of Grunt template
module.exports = function(grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json')
});
grunt.registerTask('default', []);
};
@shaosh
shaosh / gist:0e159b9db3dc90b8c719
Last active March 17, 2016 23:53
Remove dash and capitalize the first letter
var a = document.getElementByTagName('view')
for(var i = 0; i < a.length; i++){
var b = a[i].id;
c = b.split('-');
for(var j = 0; j < c.length; j++){
c[j] = c[j].replace(/^./, c[j][0].toUpperCase());
}
var d = c.join('');
console.log(d)
@shaosh
shaosh / HtmlParser
Created January 21, 2015 17:05
Simple HTML Parser
function HtmlParser(){}
function Stack(){
this.stac = [];
this.pop = function(){
return this.stac.pop();
};
this.push = function(item){
this.stac.push(item);
};
this.peek = function(){
@shaosh
shaosh / gist:40cb2db191d6dc755251
Created September 16, 2014 18:30
Batch Script to Create files and folders
if not exist "reports\" (mkdir reports)
cd reports
if exist report.xml (
del "report.xml"
)
type nul >report.xml
echo ^<?xml version="1.0" encoding="UTF-8"?> >> report.xml