Skip to content

Instantly share code, notes, and snippets.

@neildaemond
neildaemond / gist:db28dcc115d69789c56db1c7fb11dc8d
Created March 18, 2022 03:57
applescript to start iTerm2 with profile
-- this applescript will start/activate iTerm (close the default window if the app had been newly started), then open a new session with a desired profile
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
set iTermRunning to is_running("iTerm2")
tell application "iTerm"
activate
@neildaemond
neildaemond / neildaemond.zsh-theme
Last active October 4, 2021 04:07
my oh-my-zsh theme (varient of philips)
# neildaemond theme is a slightly tuned version of "philips":
# - I wanted hostname & and full path based on '~'
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
PROMPT='%{$fg[$NCOLOR]%}%B%n%{$fg[green]%}@%M%b%{$reset_color%}:%{$fg[blue]%}%B%~/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
RPROMPT='[%*]'
# git theming
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}%B"
ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} "
@neildaemond
neildaemond / keybindings.json
Last active April 20, 2020 07:49
VSCode keybindings.json for sane navigation when using vim extension.
// place at ~/.config/Code/User/keybindings.json
[
{
"key": "ctrl+w",
"command": "workbench.files.action.focusFilesExplorer",
"when": "!editorIsOpen && !multipleEditorGroups"
},
{
"key": "ctrl+w",
"command": "-workbench.action.closeWindow",
@neildaemond
neildaemond / install-vim-8-with-python-ruby-lua-ubuntu.sh
Last active August 15, 2019 16:39 — forked from erickpatrick/install-vim-8-with-python-ruby-lua-ubuntu.sh
Install Vim 8 with Python, Python 3, Ruby (2.5) and Lua support on Ubuntu
# remove current vim
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
# removes current link for vim
sudo rm -rf /usr/local/share/vim /usr/bin/vim
# add ppa for newest version of ruby (currently, as of 06/06/2017, ruby v2.4)
#sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
Generally, I use The Pathogen plugin to manage my plugins, and I strongly reccomend you switch to using it too.
The update_bundles script was written by Tammer Saleh, and published by him in his blog post which talks about why we should switch to Pathogen plugin for vim:
http://tammersaleh.com/posts/the-modern-vim-config-with-pathogen
His update_bundles script will remove plugins from the bundle folder, then grab the most updated version from their respective git repositories. You can modify that script to include/exclude your vim plugins which reside in ./bundle
//no longer using scala... so ignore the following block
//I have added scala support for exuberant-ctags by adding a .ctag file containing regex expressions found on
#!/bin/bash
## this script is based on:
## https://elinux.org/RPi_Text_to_Speech_(Speech_Synthesis)
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=$1&tl=en"; }
recorded=(
"My first comment is that soemthing comes first",
"Then the Second thing comes",
import Hex {- from rtfeldman/elm-hex/1.0.0 -}
import Bitwise
import Char
hashOpp : Char -> Int -> Int
hashOpp char hash =
(Char.toCode char) + ((Bitwise.shiftLeftBy 5 hash) - hash)
stringToHexColor : String -> String
function hashCode(str) { // java String#hashCode
var hash = 0;
for (var i = 0; i < str.length; i++) {
hash = str.charCodeAt(i) + ((hash << 5) - hash);
}
return hash;
}
function intToRGB(i){
var c = (i & 0x00FFFFFF)
@neildaemond
neildaemond / index.html
Last active August 6, 2018 09:21
elm-live Boilerplate: index.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<center><h1>Elm Boilerplate!</h1></center>
<br/><br/>
<div id="elm_target"></div>
<script>
@neildaemond
neildaemond / text_to_voice.sh
Created April 24, 2018 01:26
text_to_voice.sh
#!/bin/bash
## this script is based on:
## https://elinux.org/RPi_Text_to_Speech_(Speech_Synthesis)
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=$1&tl=en"; }
recorded=("Step One. go to the box in the corner",
"Step Two. input a template name")