Skip to content

Instantly share code, notes, and snippets.

View divyanshu013's full-sized avatar
:shipit:
Ship it

Divyanshu Maithani divyanshu013

:shipit:
Ship it
View GitHub Profile
@divyanshu013
divyanshu013 / global.css
Last active December 20, 2021 20:12
Modern CSS Reset (remastered)
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
body,
h1,
@divyanshu013
divyanshu013 / GFX Info (after Hermes)
Created July 9, 2020 07:30
Instawork app performance metrics
Applications Graphics Acceleration Info:
Uptime: 217811477 Realtime: 1099735775
** Graphics info for pid 28939 [com.instaworkmobile.beta] **
Stats since: 217791859437958ns
Total frames rendered: 497
Janky frames: 61 (12.27%)
50th percentile: 7ms
90th percentile: 17ms
@divyanshu013
divyanshu013 / build.log
Last active May 15, 2020 15:35
Gatsby incremental build logs
8:59:58 PM: Build ready to start
9:00:00 PM: build-image version: 6dfe19d15f524c85d6f9bf7df9fb30b0a9f0a61a
9:00:00 PM: build-image tag: v3.3.10
9:00:00 PM: buildbot version: 0d19834c19ebfe54208907d729718495339fe085
9:00:00 PM: Fetching cached dependencies
9:00:00 PM: Starting to download cache of 349.7MB
9:00:02 PM: Finished downloading cache in 1.76825814s
9:00:02 PM: Starting to extract cache
9:00:20 PM: Finished extracting cache in 18.474851627s
9:00:20 PM: Finished fetching cache in 20.339023534s
@divyanshu013
divyanshu013 / extensions.json
Created June 15, 2019 10:12
VSCode's Settings - Syncing
[
{
"id": "agauniyal.vscode-caniuse",
"name": "vscode-caniuse",
"publisher": "agauniyal",
"version": "0.5.0"
},
{
"id": "alefragnani.project-manager",
"name": "project-manager",
@divyanshu013
divyanshu013 / index.js
Created March 18, 2019 13:54
Final generator with writing method added
const Generator = require('yeoman-generator');
module.exports = class extends Generator {
// ...
writing() {
this.log('Writing files... 📝');
const { type, name } = this.answers;
if (type === 'screen') {
@divyanshu013
divyanshu013 / component.js
Created March 18, 2019 13:38
React component and redux module template
import React from 'react';
import { View } from 'react-native';
const <%= name %> = () => (
<View>
</View>
);
export default <%= name %>;
@divyanshu013
divyanshu013 / index.js
Created March 18, 2019 10:38
Adding prompting to generator
const Generator = require('yeoman-generator');
module.exports = class extends Generator {
// ...
async prompting() {
this.log('Generator starting... 🤖');
this.answers = await this.prompt([
{
@divyanshu013
divyanshu013 / index.js
Last active March 18, 2019 07:28
Generator - Basic
const Generator = require('yeoman-generator');
module.exports = class extends Generator {
constructor(args, options) {
super(args, options);
}
// first stage
async prompting() {
this.log('Generator starting... 🤖');
@divyanshu013
divyanshu013 / package.json
Created February 21, 2019 11:58
Package json for yeoman generator
{
"name": "generator-example",
"version": "1.0.0",
"description": "Yeoman generator example",
"files": ["generators"],
"keywords": ["yeoman-generator"],
"author": "Divyanshu Maithani <div.blackcat@gmail.com> (https://github.com/divyanshu013)",
"license": "MIT",
"dependencies": {
"yeoman-generator": "^3.2.0"
@divyanshu013
divyanshu013 / wtf.md
Created October 7, 2018 17:19
javascript wtf

Filter out truthy values

const array = ['a', 1, null, ''].filter(Boolean); // ['a', 1]
// filters out truthy values

Flush promises wait