- install blueutil (cli app to control bluetooth) and sleepwatcher (run commands on sleep and wake)
brew install blueutil sleepwatcher
- find the address of your headphones with blueutil
> blueutil --paired
brew install blueutil sleepwatcher
> blueutil --paired
Install Q3 fork ioquake3 along with original game patch files (baseq3/pak{1-8}.pk3, missionpack/pak{1-3}.pk3)
brew cask reinstall ioquake3
Build ioquake3 master branch
git clone https://github.com/ioquake/ioq3
Notes on building a small application (two lambdas and a step function state machine) with the CDK (TypeScript).
cdk init
can only be run in an empty directory. The name of this directory is used throughout the generated code, notably as the name of the generated stack. It seems like the intention is to use the root directory of the project for the CDK code as well as any other source code. I preferred to separate the CDK code from Scala, so I put it into its own subdirectory that was ultimately named cdk
, but when running cdk init
I temporarily gave it the same name as my project so the generated stack name made sense (e.g. MyProjectStack
instead of CdkStack
).
CDK applications are made by composing constructs. A construct is a representation of an AWS Resource at varying levels of abstraction. Some are auto-generated and therefore as low-level as CloudFormation itself, others provide a
package com.gu.emr.util | |
import java.util.concurrent.{Future => JavaFuture} | |
import com.amazonaws.services.elasticmapreduce.model._ | |
import com.amazonaws.{AmazonWebServiceRequest, AmazonWebServiceResult} | |
import scala.concurrent.{ExecutionContext, Future} | |
trait Marking[Request, Result] { |
# run as root | |
initctl list | grep -E 'hadoop|hive|spark|yarn' | cut -d' ' -f1 | xargs -L1 restart |
import scala.util.Random | |
// http://www.decisionsciencenews.com/2017/06/19/counterintuitive-problem-everyone-room-keeps-giving-dollars-random-others-youll-never-guess-happens-next/ | |
case class Person(var balance: Int) { | |
def receive(amount: Int): Unit = { | |
balance = balance + 1 | |
} | |
def give(amount: Int, other: Person): Unit = { |
function Queue() { | |
this.queue = []; | |
} | |
/** | |
* Add an item to the queue | |
* | |
* @param {Anything} item item to add | |
* @return {Number} queue length |
grep -nHC1 "2\.2\.0" npm-shrinkwrap.json \ | |
| grep -A1 ansi-styles \ | |
| grep npm-shrinkwrap.json: \ | |
| cut -d: -f2 \ | |
| xargs -I"{}" -n1 sed -i {}s/\.0/\.1/ npm-shrinkwrap.json |
#!/bin/sh | |
INSTPREFIX="/opt/cisco/anyconnect" | |
BINDIR="${INSTPREFIX}/bin" | |
PLUGINSDIR="${BINDIR}/plugins" | |
LIBDIR="${INSTPREFIX}/lib" | |
PROFILESDIR="${INSTPREFIX}/websecurity" | |
ACMANIFESTDAT="${INSTPREFIX}/VPNManifest.dat" | |
WEBSECMANIFEST="ACManifestWebSecurity.xml" | |
UNINSTALLLOG="/tmp/websecurity-uninstall.log" |
;; 559e3224324a2b6e66000046 | |
(defn cart [n] | |
(let [n (+ n 1)] | |
(for [x (range 1 n) y (range 1 n)] [x y]))) | |
(defn xf [f] (map (fn [[x y]] (f x y)))) | |
(defn sumin [n] | |
(transduce (xf min) + (cart n))) |