Skip to content

Instantly share code, notes, and snippets.

rajatbarman / dabblet.css
Created September 29, 2015 20:48
ul {position: relative;margin: 0;padding: 0;}li {display: inline-block;width: 100px;text-align: center;border-bottom: 5px solid #ccc;} ~ div {left: 200px;background: blue;} ~ div {left: 100px;background: green;} ~ div{background: red;left: 0;}div {position: absolute;height: 5px;top: 17px;width: 100px;transition: all 1s ease;left: 0;}
rajatbarman / webpack.config.js
Last active November 18, 2016 11:14 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
//Explanation for the config file can be found here
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
"name": "mm-react",
"version": "1.0.0",
"description": "Micro Market App on React",
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server --content-base app --inline --hot",
"test": "echo \"Error: no test specified\" && exit 1"
"author": "",
rajatbarman / imagemin-lambda-handler.js
Last active June 16, 2019 11:30
Lambda function for Imagemin to optimize JPEGs and PNGs
Copies Original File to originals/ folder in the same bucket
Optimizes jpeg/png, writes the optimized jpeg/png in the same path
If optimized jpeg/png size is somehow greater than the original, optimization is skipped.
Webp version of the optimized jpeg/png is created and written in webps folder in the same bucket
If webp version size is greater than optimized jpeg/png, webp write is skipped.
For preparing imagemin binaries for the lambda runtime environment
const spawn = require('child_process').spawn;
for (let i=0; i <=10; i++) {
spawn('node', ['--max-old-space-size=2048', './test.js', `test${i}`, 5], {
stdio: 'inherit'
const puppeteer = require('puppeteer');
const Xvfb = require('xvfb');
const xvfb = new Xvfb({ reuse: true });
const width = 3840;
const height = 2160;
const options = {
headless: false,
args: [
"$schema": "",
"basics": {
"name": "Rajat Barman",
"label": "Frontend guy | Ex Pharmeasy, Toppr, Oyo Rooms",
"image": "",
"email": "",
"phone": "",
"summary": "Coding philosophies - Write simple and explicit code -- Develop for users not for deadlines -- Express yourself through your work -- Be attentive to details.",
"location": {
rajatbarman / gist:133b55a83637592801069afdae22d804
Last active February 9, 2024 08:23
port: 8000
graphiql: true
hostname: ""
responseHeaders: [
{key: "Content-Security-Policy", value: "frame-ancestors 'self' http://localhost:8080 http://localhost:3000 https://* https://*;"}
{key: "Cross-Origin-Resource-Policy", value: "cross-origin"}
{key: "Cross-Origin-Embedder-Policy", value: "credentialless"}