Skip to content

Instantly share code, notes, and snippets.

View Venugopal46's full-sized avatar

Venugopal Venugopal46

View GitHub Profile
var fs = require('fs');
// string generated by canvas.toDataURL()
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0"
+ "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO"
+ "3gAAAABJRU5ErkJggg==";
// strip off the data: url prefix to get just the base64-encoded bytes
var data = img.replace(/^data:image\/\w+;base64,/, "");
var buf = new Buffer(data, 'base64');
fs.writeFile('image.png', buf);
const urlParser = url => {
const parser = document.createElement('a');
parser.href = url;
return parser;
};
const compareSearchParams = (p1, p2) => {
const urlParams1 = new URLSearchParams(p1);
const urlParams2 = new URLSearchParams(p2);
var keys1 = urlParams1.keys();
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
var fs = require('fs');
var path = '../file-sort/source';
function readDir(path) {
var files = fs.readdirSync(path), modTime, folder;
for (var i in files) {
if (fs.lstatSync(path + '/' + files[i]).isDirectory()) {
readDir(path + '/' + files[i]);
} else {
modTime = fs.statSync(path + '/' + files[i]).mtime;
import React from 'react';
import PropTypes from 'prop-types';
const SnackbarWrapper = (Component) => {
class Decorated extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
active: props.active
};
@Venugopal46
Venugopal46 / .eslintrc
Created November 2, 2016 04:43
eslint config file
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"globals": {
"React": true
},
"parserOptions": {