Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version
This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.
require "string" | |
function checkBluetoothResult(rc, stderr, stderr) | |
if rc ~= 0 then | |
print(string.format("Unexpected result executing `blueutil`: rc=%d stderr=%s stdout=%s", rc, stderr, stdout)) | |
end | |
end | |
function bluetooth(power) | |
print("Setting bluetooth to " .. power) |
Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version
This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.
Most recently tested on macOS Sierra (10.12.6)
curl https://bootstrap.pypa.io/get-pip.py -o ~/Downloads/get-pip.py
--user
flag; python ~/Downloads/get-pip.py --user
. pip will be installed to ~/Library/Python/2.7/bin/pip~/Library/Python/2.7/bin
is in your $PATH
. For bash
users, edit the PATH=
line in ~/.bashrc
to append the local Python path; ie. PATH=$PATH:~/Library/Python/2.7/bin
. Apply the changes, source ~/.bashrc
.--user
when installing modules; ie. pip install <package_name> --user
import React from "react"; | |
import { render } from "react-dom"; | |
const ParentComponent = React.createClass({ | |
getDefaultProps: function() { | |
console.log("ParentComponent - getDefaultProps"); | |
}, | |
getInitialState: function() { | |
console.log("ParentComponent - getInitialState"); | |
return { text: "" }; |
Simple toggleable menubar replacement for Caffeine in Hammerspoon, utilizing ASCIImage (for vector) to create the amphetamine icons. Motivated by the official Caffeine app's icon looking bad on Retina
Get latest version here: amphetamine.lua
Save as amphetamine.lua
in ~/.hammerspoon/
and put amphetamine = require "amphetamine"
in your init.lua
# Defaults / Configuration options for homebridge | |
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others) | |
HOMEBRIDGE_OPTS=-U /var/lib/homebridge | |
# If you uncomment the following line, homebridge will log more | |
# You can display this via systemd's journalctl: journalctl -f -u homebridge | |
# DEBUG=* |
React introduced shallow rendering in 0.13. This is an excellent feature that I wish was included earlier in React. It aims to solve the problem of unit testing components without going through a real, or jsdom mocked, DOM. I couldn't find any info online about what lifecycle events it actually fires. So I did some testing of my own. To reproduce, put component.js
and test.js
into a folder and run node test.js
.
TLDR; shallow rendering only invokes the following lifecycle hooks (in order):
getDefaultProps
getInitialState
componentWillMount
stops here until re-rendercomponentWillReceiveProps
shouldComponentUpdate
componentWillUpdate
#!/bin/sh | |
## | |
# Quick Look Plugins | |
# @url http://caskroom.io | |
# @brief Quick Look Plugins installed via Homebrew Cask | |
# | |
# For a comprehensive overview of Quick Look plugins look here: https://github.com/sindresorhus/quick-look-plugins | |
# | |
brew cask install qlcolorcode # Preview source code files with syntax highlighting | |
brew cask install qlstephen # Preview plain text files without a file extension. Example: README, CHANGELOG, etc. |
#!/bin/sh | |
# check for where the latest version of IDEA is installed | |
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1` | |
wd=`pwd` | |
# were we given a directory? | |
if [ -d "$1" ]; then | |
# echo "checking for things in the working dir given" | |
wd=`ls -1d "$1" | head -n1` |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000