Skip to content

Instantly share code, notes, and snippets.

@Sam1301
Sam1301 / RerenderTest.js
Last active January 2, 2019 11:04 — forked from joshma/WhyDidYouUpdateMixin.js
Test duplicate renders of your components with this HOC
// originally implemented as a mixin,
// taken from https://gist.github.com/joshma/6753333dd38a6010f9a6#file-whydidyouupdatemixin-js
// modified to make a higher-order component
/* eslint-disable no-console */
import _ from 'underscore';
import React, { Component, PureComponent } from 'react';
function isRequiredUpdateObject(o) {
return Array.isArray(o) || (o && o.constructor === Object.prototype.constructor);
function injectGitFileStatus()
{
const timeout = 5000;
const addedColor = "#8dc149";
const modifiedColor = "#cbcb41";
const stagedColor = "#ca2820";
const ignoredOpacity = "0.4";
const explorer = document.getElementById("workbench.view.explorer");
if (explorer)
dialog {
position: fixed;
top: 50%;
left: 50%;
right: auto;
padding: 30px;
transform: perspective(500px) translate(-50%, -50%);
background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF;
border: none;
border-radius: 3px;
@carolineartz
carolineartz / cub-n-pup-puzzle-game-demo.markdown
Created December 11, 2017 15:45
Cub n Pup - puzzle game demo

Cub n Pup - puzzle game demo

How to play: Drag cub to star, Drag grid to rotate.

Also available at cubnpup.com

This is a proof-of-concept for a game. Basic art, no sound, no options, no polish. But the core game-play is there. It's more of a mobile game, focused on dragging — inspired by Threes. I'm looking to see if its any fun. Let me know!

I've always wanted to make a video game. This could be the one. My previous attempts never got past isolated demos because they were aiming for bigger ideas. They grew complex and unwieldy. So this game is designed to be simple. A game that I can actually make.

@divyanshu013
divyanshu013 / .hyper.js
Last active April 5, 2019 11:54
My Hyper 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: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'canary',
@divyanshu013
divyanshu013 / code.settings
Last active May 21, 2020 02:18
My VSCode settings
{
"vscode_custom_css.imports": [
"file:///Users/divyanshu/.vscode/style.css"
],
"editor.fontFamily": "'Fira Code', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"javascript.validate.enable": false,
"editor.fontLigatures": true,
"editor.minimap.enabled": false,
"editor.multiCursorModifier": "ctrlCmd",
"workbench.startupEditor": "newUntitledFile",
@divyanshu013
divyanshu013 / .zshrc
Last active October 10, 2018 08:00
My zsh config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/div/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
@divyanshu013
divyanshu013 / code.ext
Last active May 21, 2020 02:18
My VSCode extensions
code --install-extension EditorConfig.EditorConfig
code --install-extension Perkovec.emoji
code --install-extension SintrumIT.theme-oceanic-next-italic
code --install-extension agauniyal.vscode-caniuse
code --install-extension alefragnani.project-manager
code --install-extension andys8.jest-snippets
code --install-extension arcticicestudio.nord-visual-studio-code
code --install-extension be5invis.vscode-custom-css
code --install-extension bierner.markdown-emoji
code --install-extension bungcip.better-toml
@threepointone
threepointone / 0 basics.md
Last active March 21, 2023 01:53
css-in-js

A series of posts on css-in-js

0. styles as objects

First, an exercise. Can we represent all of css with plain data? Let's try.

let redText = { color: 'red' };
@jakub-g
jakub-g / async-defer-module.md
Last active June 4, 2024 19:24
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)