Skip to content

Instantly share code, notes, and snippets.

@multimonos
multimonos / so_you_only_have_sudo.md
Last active July 12, 2016 13:32
Setup a developer machine with only sudo

So, you only have sudo and you need to setup a mac machine with only sudo...you'll likely need these commands

Install Application Foobar.app

  • mount the image

sudo cp -R /path/to/Foobar.app /Applications

Open Application Foobar.app

sudo open -a /path/to/Foobar.app

# Xpath
## Reference
- https://www.w3.org/TR/xpath/
## Examples
You can test xpath in the Chrome Inspector Elements Panel via the Find operation.
Given,
Fetch headers and follow redirects
```
curl --head --location <url>
```
# Install
Init package,
```
cd /path/to/app
npm init
```
Install webdriverio,
```
npm i --save-dev webdriverio
@multimonos
multimonos / webpack_dev_server
Last active November 10, 2017 15:52
how to get auto-refresh + webpack to work
Install `webpack` and `webpack-dev-server`,
```
npm i --save-dev webpack
npm i --save-dev webpack-dev-server
```
Start the webpack server,
```
webpack-dev-server --env development
```
@multimonos
multimonos / json-stream.js
Last active July 3, 2018 20:08
JSON stream to use in cli pipe
#!/usr/bin/env node
const through2 = require("through2");
let raw = "";
process.stdin
.pipe(through2(function(chunk, enc, cb) {
this.push(chunk.toString());
cb();
@multimonos
multimonos / sculpt_keyboard_mac_osx_karbiner_elements_setup
Last active March 9, 2019 01:26
Microsoft Sculpt Keyboard Karabiner Elements Setup
# mirror mac keyboard setup
left_option => left_command
left_command => left_option
right_option => right_option
application => right_option
# vim users
caps_lock => escape
@multimonos
multimonos / sculpt_mouse_mac_osx_karbiner_elements_setup
Last active March 9, 2019 01:33
Microsoft Sculpt Ergonomic Mouse Karabiner Elements Setup
# side button ( works well for Houdini )
button4 => button3
# wheel button
button3 => mission_control
@multimonos
multimonos / sculpt_karabiner_elements_setup_json
Created March 9, 2019 01:32
Karabiner Elements Setup for Microsoft Sculpt Devices on Mac OS
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@multimonos
multimonos / pj-run.sh
Last active March 23, 2019 17:08
processing-java bash script to simplify running on command line
#!/usr/bin/env bash
usage="usage: pj-run /absolute/path/to/sketch/directory"
abspath() {
cd "$1"
echo "$(pwd -P)"
}
assert_is_directory() {