To compare last two commits.
git diff HEAD^ HEAD
Since comparison with HEAD is the default you can omit it for even shorter syntax.
Follow the instructions on Github to Create an Access Token in Github
By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.
You can tell Git you want to store credentials in the osxkeychain by running the following:-
scala.collection.Searching provides binary search but you need an Indexed sequence (eg. Array
), not a Linear sequence (eg. List
). Search will still work on the List but you get linear O(n) behaviour rather than O(Log n).
case class Employee (id: Int, name: String, age: Int)
val emp1 = Employee(1, "Jane Doe", 45)
val emp2 = Employee(2, "Jon Doe", 54)
val emp3 = Employee(3, "Tera Patrick", 38)
val emp4 = Employee(4, "Jenna Jameson", 36)
val emp5 = Employee(5, "Aurora Snow", 34) // not added
#!/bin/bash | |
# create directory for python install | |
sudo mkdir -p /opt/bin | |
sudo chown -hR core:core /opt | |
cd /opt | |
# check for newer versions at http://downloads.activestate.com/ActivePython/releases/ | |
wget http://downloads.activestate.com/ActivePython/releases/3.6.0.3600/ActivePython-3.6.0.3600-linux-x86_64-glibc-2.3.6-401834.tar.gz | |
tar -xzvf ActivePython-3.6.0.3600-linux-x86_64-glibc-2.3.6-401834.tar.gz |
#!/usr/bin/env zsh | |
git show-branch -a \ | |
| grep '\*' \ | |
| grep -v `git rev-parse --abbrev-ref HEAD` \ | |
| head -n1 \ | |
| sed 's/.*\[\(.*\)\].*/\1/' \ | |
| sed 's/[\^~].*//' |
Program: Visual Studio Code
Extension: Code Runner 0.9.10 (code-runner-0.9.10)
Problem: When attempting to run a script/program, VS Code reports error: "command 'code-runner.run'"
Fix: Manually edit extension code.
Edit extension file codeManager.js
On macOS this is usually at ~/.vscode/extensions/formulahendry.code-runner-0.9.10/out/src/codeManager.js
Comment out line 12.
cask "mysqlworkbench-8.0.22" do | |
version "8.0.22" | |
sha256 "4e27de82d869043cf80e803f1a57cc041a91cabddf0aa6a6c054d68af1837d48" | |
url "https://downloads.mysql.com/archives/get/p/#{version.major}/file/mysql-workbench-community-#{version}-macos-x86_64.dmg" | |
name "MySQL Workbench" | |
desc "Visual tool to design, develop and administer MySQL servers" | |
homepage "https://www.mysql.com/products/workbench/" | |
app "MySQLWorkbench.app" |
cask "mysqlworkbench-8.0.25" do | |
version "8.0.25" | |
sha256 "8da15d32d0c3cc8d43e49f8d3580ddec0d8dcd718153da7c934acf26f83ea0c5" | |
url "https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-#{version}-macos-x86_64.dmg" | |
livecheck do | |
url "https://dev.mysql.com/downloads/workbench/" | |
strategy :page_match | |
regex(/MySQL\s*Workbench\s*(\d+(?:\.\d+)*)/i) | |
end |