Skip to content

Instantly share code, notes, and snippets.

gaearon / index.html
Last active Jun 16, 2021
Add React in One Minute
View index.html
<!DOCTYPE html>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
dtbaker / exportImagesFromFigma.js
Created Nov 28, 2019
Extract Images from Figma to S3
View exportImagesFromFigma.js
// This takes an array of images (from getFigmaImageIds) and exports them to S3.
const exportImagesFromFigma = async ({figmaImages, figmaExportScale = 1}) => {
const figmaFileId = await getSecretConfiguration('figma_file_id')
const figmaApiKey = await getSecretConfiguration('figma_api_key')
const exportedImages = []
const imageIdsToExport = => image.imageId)
JohannesDeml /
Last active Jun 16, 2021
Remove Unity mobile notification warning for WebGL builds

Remove warning

Unity shows the following warning on mobile devices up to Unity 2019.4: "Please note that Unity WebGL is not currently supported on mobiles. Press OK if you wish to continue anyway." This script helps you remove this warning

Live example

To see live examples see Unity Web GL Loading Test


The script will run after the build has completed and replace the checks from all generated javascript files.


paztek / app.module.ts
Created Jul 18, 2020
View app.module.ts
import { Module } from '@nestjs/common';
import { HttpModule } from './http/http.module';
import { FooModule } from './foo/foo.module';
imports: [
FooModule, // <- we'll make use of the "augmented" HttpService in this module
View gist:c7c3bed6cdbf146f5005dc928b860e93
<color name="grey">#eeefee</color>
<color name="black">#191819</color>
<color name="white">#f7f6f9</color>
jackawatts /
Last active Jun 16, 2021
Getting started with Typescript, React and Jest

Getting Started

  1. Install:
  • jest: npm install --save-dev jest
  • ts-jest: npm install --save-dev ts-jest @types/jest
  1. Modify package.json
"jest": {
  "transform": {
    "^.+\\.tsx?$": "ts-jest"
lolzballs /
Created Mar 22, 2015
Hello World Enterprise Edition
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
andiwand / 01-default-route
Last active Jun 16, 2021
OpenWrt / LEDE hotplug script to add default routes correctly.
View 01-default-route
# OpenWrt / LEDE hotplug script to add default routes correctly.
# Location "/etc/hotplug.d/iface/01-default-route".
# Fixed mwan3 "No default route in the main routing table" and
# "WARNING: this interface has no default route in the main routing table!" for me.
uci get "network.${INTERFACE}.gateway" > /dev/null 2>&1 || exit
View disposable-email-provider-domains
idudinov / prerenderPlugin.js
Last active Jun 16, 2021
PrerenderPlugin for HtmlWebpackPlugin – Pre-renders html during Webpack build phase
View prerenderPlugin.js
const HtmlWebpackPlugin = require('html-webpack-plugin');
const jsdom = require('jsdom');
/** @typedef {import("webpack/lib/Compiler.js")} WebpackCompiler */
/** @typedef {import("webpack/lib/Compilation.js")} WebpackCompilation */
/** @typedef {(import 'jsdom').ResourceLoaderConstructorOptions} ResourceLoaderConstructorOptions */
class PrerenderHtmlPlugin {
constructor(options) {
this._options = options || { };