Skip to content

Instantly share code, notes, and snippets.

View zoxon's full-sized avatar

Zoxon zoxon

View GitHub Profile
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const { createBundleRenderer } = require('vue-server-renderer');
const clientConfig = require('./build/webpack.client.config');
const serverConfig = require('./build/webpack.server.config');
const clientCompiler = webpack(clientConfig);
const serverCompiler = webpack(serverConfig);
const app = require('express')();
const express = require('express');
const htm = require('htm');
const vhtml = require('vhtml');
// create an html`` tag function for vhtml:
const html = htm.bind(vhtml);
const App = (props) => html`
<div class="app">
<h1>This is an app</h1>
@arayaryoma
arayaryoma / index.ts
Created May 3, 2018 08:14
How to use nanoid with TypeScript
import nanoid from 'nanoid';
console.log(nanoid());
@Rich-Harris
Rich-Harris / prepack-svelte.md
Last active May 19, 2022 11:02
Is Prepack like Svelte?

Note: I'm not involved in Prepack in any way — please correct me if I say anything incorrect below!

A few people have asked me if Prepack and Svelte are similar projects with similar goals. The answer is 'no, they're not', but let's take a moment to explore why.

What is Prepack?

Prepack describes itself as a 'partial evaluator for JavaScript'. What that means is that it will run your code in a specialised interpreter that, rather than having some effect on the world (like printing a message to the console), will track the effects that would have happened and express them more directly.

So for example if you give it this code...

Delete Git branch both locally and remotely?

git push origin --delete <branch_name>
git branch -d <branch_name>
@lukecav
lukecav / DNS Prefetch domains
Last active March 30, 2024 20:53
WP Rocket - Advanced Options Prefetch DNS requests examples
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
@LoyEgor
LoyEgor / gulpfile.js
Last active March 13, 2023 17:22
best image compression settings (gulp-imagemin)
// install
// npm i gulp-cache gulp-imagemin imagemin-pngquant imagemin-zopfli imagemin-mozjpeg imagemin-giflossy -f
// node node_modules/jpegtran-bin/lib/install.js
// node node_modules/gifsicle/lib/install.js
// node node_modules/zopflipng-bin/lib/install.js
// node node_modules/mozjpeg/lib/install.js
// node node_modules/giflossy/lib/install.js
// node node_modules/pngquant-bin/lib/install.js
@jtulk
jtulk / index.js
Created December 29, 2016 17:56
A more efficient reducer for adding/editing/removing objects in an array using a hash table
const initialState = {
byId: ['1', '2', '3'],
byHash: {
'1': {id: '1', content: {title: 'item 1'}},
'2': {id: '2', content: {title: 'item 2'}},
'3': {id: '3', content: {title: 'item 3'}}
}
}
const action1 = {
@hfalucas
hfalucas / [1] main.js
Last active March 13, 2024 05:49
[Vue.js] Authentication and Authorization
/**
* Think of this "main.js" file as your application bootstrap.
*/
import Vue from 'vue'
import Resource from 'vue-resource'
import VueRouter from 'vue-router'
import routes from './routes'
import middleware from './middleware'
@zoxon
zoxon / photoshop-hot-keys.md
Last active March 24, 2017 09:49
Часто используемые горячие клавиши для Photoshop

Часто используемые горячие клавиши для Photoshop

Разное

  • Ctrl + TAB – переключение вкладок;
  • Alt + колесико – увеличение/уменьшение масштаба (инструмент «Масштаб»);
  • Зажатый пробел – перетаскивание (инструмент «Рука»);
  • Ctrl + S – сохранить;
  • Ctrl + Z – отмена;
  • Ctrl + Alt + Z – шаг назад (многократный);
  • Ctrl + Shift + Z – шаг вперед (многократный);