Skip to content

Instantly share code, notes, and snippets.

@b01
b01 / download-vs-code-server.sh
Last active February 1, 2023 17:10
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
View download-vs-code-server.sh
#!/bin/sh
set -e
# Auto-Get the latest commit sha via command line.
get_latest_release() {
tag=$(curl --silent "https://api.github.com/repos/${1}/releases/latest" | # Get latest release from GitHub API
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' ) # Pluck JSON value
@b01
b01 / json-to-src
Created December 3, 2016 18:13
Sample file to pass a PHP command line script a PHP callable.
View json-to-src
<?php
/**
* Modify the template data.
*
* @param array $renderData
* @return array
*/
return function (array $renderData) {
$renderData['classNamespace'] = 'Tests\\Companies';