Skip to content

Instantly share code, notes, and snippets.

@artemave
artemave / iterm_mouse_click_file_to_vim.md
Last active January 23, 2024 10:03
Mouse click in tmux window1 - open file in tmux window2 vim

I write javascript code. I use CLI for everything I can and Chrome debug tools for everything else. I write code in cli vim, under tmux session.

I normally have tmux sessions (one per project) so I can quickly switch between them without closing/opening new terminal windows, cd'ing, etc.

I also have some automation that allows me to run particular tests from within vim such that it runs in a separate (designated to tests) tmux window.

I really love my setup (even though, at this point, it's probably more out of habit than anything else) and I don't want anything else.

But. The other day I've been pairing with my mate Josh and he kept doing this one thing over and over again and it was such a basic thing, yet such powerful thing at the same time, that I could feel my perfect cli world shaking.

@artemave
artemave / watch-tags.sh
Created January 29, 2019 14:31
Regenerate tags file when files change
fswatch -0 -r . | xargs -0 -n 1 git ls-files | tee /dev/tty | xargs -n 1 ctags $(git ls-files)
@artemave
artemave / stubLocation.js
Created January 11, 2019 11:38
Stub window location for hyperdom router
var isBrowser = typeof window !== 'undefined';
var pushState, replaceState;
pushState = replaceState = function(state, title, url) {
window.location.pathname = url;
(window.__registeredEvents['onpopstate'] || []).forEach(cb => cb({}));
};
if (!isBrowser) {
@artemave
artemave / createDriver.js
Last active January 7, 2019 11:42
Set Webdriver `user-data-dir` to keep breakpoints between test runs
const {Builder} = require('selenium-webdriver')
const driver = new Builder()
.forBrowser('chrome')
.setChromeOptions(
new chrome.Options()
.addArguments('user-data-dir=./.webdriver-chrome-user-data')
)
This file has been truncated, but you can view the full file.
iTerm2 version: 3.1.7
Date: 2018-07-27 07:59:08 +0000 (1532678348)
Key window: <iTermWindow: 0x7febce445a30 frame=NSRect: {{-0, 233}, {946, 567}} title=1. tmux alpha=1.000000 isMain=1 isKey=1 isVisible=1 delegate=0x7febce4254d0>
Windows:
Window <NSComboBoxWindow: 0x7febce42fca0>
<NSScrollView: 0x6000001d3bf0> frame=NSRect: {{0, 0}, {0, 0}} hidden=no alphaValue=1.00 tracking_areas=none
| <NSClipView: 0x7febce42c740> frame=NSRect: {{0, 0}, {0, 0}} hidden=no alphaValue=1.00 tracking_areas=none
| | <NSComboTableView: 0x7febce42b840> frame=NSRect: {{0, 0}, {13, 0}} hidden=no alphaValue=1.00 tracking_areas=none
| <NSScroller: 0x6000001d3ec0> frame=NSRect: {{-16, 0}, {16, 0}} hidden=YES alphaValue=1.00 tracking_areas=none
import { expect } from 'chai';
export default function(browser) {
return browser.component({
fetchTODOsButton() {
return this.find('button');
},
loadingBar() {
return this.find('.loading', {text: 'Loading...'});

Keybase proof

I hereby claim:

  • I am artemave on github.
  • I am artemave (https://keybase.io/artemave) on keybase.
  • I have a public key whose fingerprint is 6E67 50F0 DF9B D888 9AB0 9BDF 18F4 4B07 68DE E283

To claim this, I am signing this object:

FROM ubuntu:16.04
run apt-get update -y
run apt-get install -y apt-transport-https ca-certificates
run apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
run echo 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' > /etc/apt/sources.list.d/docker.list
run apt-get update -y
run apt-get install -y linux-image-extra-virtual
run apt-get install -y docker-engine curl
run curl -L https://github.com/docker/machine/releases/download/v0.7.0/docker-machine-`uname -s`-`uname -m` > /usr/local/bin/docker-machine && \
@artemave
artemave / test.js
Last active February 12, 2016 12:18
Batches of concurrent jobs with js promises
var http = require('httpism');
var _ = require('underscore');
var p1 = () => http.get('http://google.com').then(() => console.log('p1'))
var p2 = () => http.get('http://google.com').then(() => console.log('p2'))
var p3 = () => http.get('http://google.com').then(() => console.log('p3'))
var p4 = () => http.get('http://google.com').then(() => console.log('p4'))
var a1 = () => Promise.all([p1(), p2()]).then(() => console.log('a1'))
var a2 = () => Promise.all([p3(), p4()]).then(() => console.log('a2'))
@artemave
artemave / index.js
Created February 4, 2016 14:14
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var mo = require('moment')
var mf = require('frozen-moment')
console.log("frozen utc", mf().utc().isSameOrAfter)
console.log("original utc", mo().utc().isSameOrAfter)