Skip to content

Instantly share code, notes, and snippets.

Avatar

James Daly jda0

View GitHub Profile
View .promptlinerc
#
# This shell prompt config file was created by promptline.vim
#
function __promptline_host {
local only_if_ssh="0"
if [ $only_if_ssh -eq 0 -o -n "${SSH_CLIENT}" ]; then
if [[ -n ${ZSH_VERSION-} ]]; then print %m; elif [[ -n ${FISH_VERSION-} ]]; then hostname -s; else printf "%s" \\h; fi
fi
}
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
View vscode.settings.json
{
// "diffEditor.renderSideBySide": false,
"diffEditor.ignoreTrimWhitespace": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.dragAndDrop": true,
"editor.fontFamily": "JetBrains Mono, Dank Mono, SF Mono, Menlo, Monaco, monospace",
"editor.fontLigatures": true,
@jda0
jda0 / setup.ps1
Last active Feb 14, 2019
Setup new PC (Chocolatey)
View setup.ps1
Write-Host "Cannot automatically install LastPass, Ubuntu, Spotify from Windows Store."
Write-Host "Installing Google Drive, Hyper, Skyfonts, Visual Studio Code from Chocolatey."
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y google-drive-file-stream hyper skyfonts vscode
Write-Host "Done. Check above for errors."
View part1.txt
Preliminary notes:
1. Where necessary the following function was used to convert parser output to
canonical form (to detect equivalent syntax trees up to associativity of
statement composition):
tx :: Stm -> Stm
tx (Comp (Comp a b) c) = tx (Comp a (Comp b c))
tx (Comp a b) = (Comp (tx a) (tx b))
tx (If b s1 s2) = (If b (tx s1) (tx s2))
View proc.hs
module Proc where
import Prelude hiding (Num, and, lookup, map)
import Control.Applicative hiding (empty)
import Control.Arrow (second)
import Control.Monad
import Data.Functor.Identity (Identity)
import Data.Map.Lazy
import Data.Maybe
@jda0
jda0 / .bash_aliases
Last active Dec 27, 2019
bash_aliases
View .bash_aliases
shopt -s expand_aliases
eval "$(hub alias -s)"
## Work Aliases
alias sow='. ~/.bash_aliases_roam';
## Command Aliases
View color.js
class Color {
constructor (r, g, b) {
this.r = r
this.g = g
this.b = b
}
toHex () {
return [this.r, this.g, this.b].reduce(
(a, b) => a + ('00' + b.toString(16)).slice(-2),
You can’t perform that action at this time.