Skip to content

Instantly share code, notes, and snippets.

View imbhargav5's full-sized avatar

Ponnapalli Bhargav imbhargav5

View GitHub Profile
@imbhargav5
imbhargav5 / download-pokemon-sprites.js
Created October 27, 2017 10:00
Download sprites from pokeapi to avoid hot linking
const download = require("image-downloader");
const path = require("path");
const pathExists = require("path-exists");
Array.from({ length: 802 }).forEach((i, index) => {
const entry = index + 1;
const downloadPath = path.join(__dirname, `public/images/${entry}.png`);
pathExists(downloadPath).then(exists => {
if (exists) {
return;
@imbhargav5
imbhargav5 / .hyper.js
Created June 6, 2017 05:21
My hyper terminal config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
const __flattenReducer = (result,value,valueIndex,arr)=>{
if(value instanceof Array){
return value.reduce(__flattenReducer,result);
}else{
result.push(value);
return result;
}
};
const flatten = function(arr){
@imbhargav5
imbhargav5 / Gulpfile.js
Last active May 24, 2016 09:51
Gulpfile which handles Git, Prompt for commits + Django on Virtual ENV + Package.json version bump + WebpackDevServer + Webpack + Open Browser + Mocha
require('babel-core/register');
var gulp = require('gulp');
var git = require('gulp-git');
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var shell = require('gulp-shell');
var os = require('os');
var open = require('gulp-open');
var gp_prompt = require('gulp-prompt');
var runSequence = require('run-sequence');
@imbhargav5
imbhargav5 / Enhance.js
Created December 3, 2015 10:03 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {