Skip to content

Instantly share code, notes, and snippets.

@gaearon
gaearon / index.html
Last active Jun 16, 2021
Add React in One Minute
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@dtbaker
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 = figmaImages.map(image => image.imageId)
@JohannesDeml
JohannesDeml / README.md
Last active Jun 16, 2021
Remove Unity mobile notification warning for WebGL builds
View README.md

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

Logic

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

Support

@paztek
paztek / app.module.ts
Created Jul 18, 2020
nestjs-http-service-example-1
View app.module.ts
import { Module } from '@nestjs/common';
import { HttpModule } from './http/http.module';
import { FooModule } from './foo/foo.module';
@Module({
imports: [
HttpModule,
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
jackawatts / ts-jest.md
Last active Jun 16, 2021
Getting started with Typescript, React and Jest
View ts-jest.md

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
lolzballs / HelloWorld.java
Created Mar 22, 2015
Hello World Enterprise Edition
View HelloWorld.java
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@andiwand
andiwand / 01-default-route
Last active Jun 16, 2021
OpenWrt / LEDE hotplug script to add default routes correctly.
View 01-default-route
#!/bin/sh
# 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
0815.ru
0wnd.net
0wnd.org
10minutemail.co.za
10minutemail.com
123-m.com
1fsdfdsfsdf.tk
1pad.de
20minutemail.com
21cn.com
@idudinov
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 || { };