Skip to content

Instantly share code, notes, and snippets.

const fs = require('fs');
const path = require('path');
const dir = './src';
const rootDir = 'web';
const targetPath = 'src/shared';
const replaceDir = path.join('@jarden-digital/megablue-apps-shared');
function walk(dir, callback) {
fs.readdir(dir, function (err, files) {
@zfwf
zfwf / metric-glossary.md
Created September 10, 2019 22:02
Analytic metrics glossary

MTU - monthly tracked user (each user is only counted once per month)

@zfwf
zfwf / vim-movements.vim
Created September 3, 2019 21:19
vim movements
Cursor movement
h - move left
j - move down
k - move up
l - move right
w - jump by start of words (punctuation considered words)
W - jump by words (spaces separate words)
e - jump to end of words (punctuation considered words)
E - jump to end of words (no punctuation)
@zfwf
zfwf / javascript-for-vim-refactoring.js
Created June 12, 2018 01:24 — forked from derwiki/javascript-for-vim-refactoring.js
Moving faster with Vim (5-minute lightning talk presentation). I wasn't inspired to learn effective command of Vim until I saw some people flying around faster than I thought was possible. The goal of this presentation is to call out how slow "normal" text editing is, and how many keystrokes can be reduced by using increasingly more terse Vim co…
$(function() {
// good opportunity to combine into a single statement
// qq w cw <esc> A, <esc> 0 j q
var a = 10;
var b = 20;
var c = 30;
var d = 40;
var e = 50;
// opportunity to simplify syntax
@zfwf
zfwf / cursor.md
Created June 4, 2018 01:46
Ubuntu bionic 18.04 change cursor theme

Install theme in /usr/share/icons

Application

In gnome-tweak-tool change cursor theme In dconf-editor search for cursor-theme and modify

GDM3 greeter

Add following to /etc/gdm3/greeter.dconf-defaults

@zfwf
zfwf / graphics-driver.md
Last active November 20, 2018 11:01
Dell dp5520 ubuntu graphics driver

use ubuntu-drivers to find out what we need

ubuntu-drivers devices

Install intel before nvidia driver (xxx is the version specified in the command output above)

sudo apt install intel-microcode sudo apt install nvidia-driver-xxx

@zfwf
zfwf / gist:64695924cb0941089f8163e73cfad209
Last active December 29, 2022 03:58
ubuntu openvpn configs
# Client configs, 16.04,
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
# network manager, 16.04, install below package to enable import openvpn client configs
sudo apt install network-manager-openvpn-gnome
# Client configs, 18.04/18.10
@zfwf
zfwf / chrome-remote-desktop.patch
Created February 9, 2018 08:40 — forked from YusukeIwaki/chrome-remote-desktop.patch
chrome-remote-desktopをdisplay 0表示するように改造するための修正ポイント
diff --git a/chrome-remote-desktop.orig b/chrome-remote-desktop
index a40063b..de1b3b0 100755
--- a/chrome-remote-desktop.orig
+++ b/chrome-remote-desktop
@@ -66,11 +66,11 @@ XORG_DUMMY_VIDEO_RAM = 1048576 # KiB
# with large or multiple monitors. This is a comma-separated list of
# resolutions that will be made available if the X server supports RANDR. These
# defaults can be overridden in ~/.profile.
-DEFAULT_SIZES = "1600x1200,3840x2560"
+DEFAULT_SIZES = "1920x1080"
@zfwf
zfwf / tm-cmds.md
Last active March 10, 2020 03:34
Terminal commands to learn

tmux

  • tmux new -s <name> create new session with
  • tmux attach -t <name> attach to session with
  • tmux kill-session -t <name> kill session with

In tmux hit prefix c-a or c-b then:

? to see a list of commands
Sessions

:new new session

@zfwf
zfwf / browser-events.md
Created September 5, 2017 22:57
browser events

Mosly from Kirupa's "Running Your code at the Right Time" link, quick, more

Basic order
  1. HTML is downloaded and parsing starts
  2. Each element is parsed, styles registered, script executed (inline or external)
  3. When entire DOM is parsed, document.DOMContentLoaded event fires, in JQuery this is the $(document).ready(), shorthand "($function() {})"
  4. When DOM and assets (including parsing of all CSS and JS) is complete, window.load event fires
Few things to note:
  1. Loading of JS blocks DOM parsing