Skip to content

Instantly share code, notes, and snippets.

View imbhargav5's full-sized avatar

Bhargav Ponnapalli imbhargav5

View GitHub Profile
@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() {
@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');
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 / .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
@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 / 000-default.conf
Last active December 28, 2017 19:33
Dockerfile for php+apache+phalcon
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName probuilds.dev
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www>
Options Indexes FollowSymLinks
@imbhargav5
imbhargav5 / SimpleTextInput_CWRP.js
Last active September 12, 2018 15:17 — forked from sagiavinash/SimpleTextInput_CWRP.js
SimpleTextInput with CWRP
class SimpleTextInput extend Component {
constructor(props){
super(props)
this.state = {
value : props.value,
_value : props.value
}
}
static getDerivedStateFromProps(newProps,oldState){
if(newProps.value !== oldState._value){
import * as React from "react";
import { useDidMount } from "shared/useDidMount";
const initialState = {
intersectionObj: {},
observerInState: null,
isVisible: false
};
interface Iaction {
html,body{
display: none;
}
const jobs = [
{
id: 1,
title: "Lead Svelte Engineer",
description:
"Amet quo non reprehenderit aspernatur non ex tenetur debitis impedit. Dolor sed est. Dolorem assumenda molestiae vitae accusantium facilis incidunt rem soluta sint. Velit tenetur quae quibusdam occaecati fuga itaque tenetur ut.",
isFeatured: true,
isRemote: false,
seniority: "Lead",
verticals: ["Frontend"]