This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isTimTimeTrackingLive() | |
local preferencesPath = os.getenv('HOME').."/Library/Containers/neat.software.Tim/Data/Library/Preferences/neat.software.Tim.plist" | |
local preferences = hs.plist.read(preferencesPath) | |
local data = hs.json.decode(preferences['Tim_Data']) | |
local tasks = data['tasks'] | |
-- When Tim has a live session, a record has the same start and end timestamp | |
for key, task in pairs(tasks) do | |
records = task['records'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "v", function() | |
-- Change your email | |
local email = "firstname.lastname@sintef.no" | |
local ciscoName = "Cisco AnyConnect Secure Mobility Client" | |
local loginWindowName = "login" | |
if hs.application.launchOrFocus(ciscoName) then | |
local ciscoApplication = hs.application.get(ciscoName) | |
local mainWindow = ciscoApplication:mainWindow() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Don't do that on production I guess | |
az resource delete --ids $(az resource list | jq ".[].id" -r) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsetopt BEEP | |
source <(/opt/homebrew/bin/starship init zsh --print-full-init) | |
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh | |
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh | |
# FZF | |
export PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin" | |
source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null | |
source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { readFileSync } from 'fs'; | |
import jose from 'node-jose'; | |
const privateKeyPath = "./private-key.pem"; | |
let privatekeyPem; | |
try { | |
privatekeyPem = readFileSync(privateKeyPath); | |
} catch (error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Pre-commit hook that verifies if all files containing 'vault' in the name | |
# are encrypted. | |
# If not, commit will fail with an error message | |
# | |
# File should be .git/hooks/pre-commit and executable | |
FILES_PATTERN='.*(vault|secrets).*\.ya?ml$' | |
REQUIRED='ANSIBLE_VAULT' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.security.KeyFactory; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.interfaces.RSAPublicKey; | |
import java.security.spec.InvalidKeySpecException; | |
import java.security.spec.X509EncodedKeySpec; | |
import java.util.Arrays; | |
import java.util.Date; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat input_file.json | sed 's/^M$//' | tail -n "+2" | head -n "-1" | sed 's/},*\r*$//' | sed 's/^.*doc"://' | grep -v '^{"_id":"_design/' > output_file.json | |
# I like useless cats, it looks cleaner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your settings in this file to overwrite the default settings | |
{ | |
"editor.fontFamily": "Fira Code", | |
"editor.fontLigatures": true, | |
"window.menuBarVisibility": "toggle", | |
"vim.useCtrlKeys": true, | |
"vim.handleKeys": { | |
"<C-a>": false, | |
"<C-f>": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%YAML 1.2 | |
--- | |
name: Fuzzy Control Language | |
file_extensions: | |
- fcl | |
scope: source.fcl | |
contexts: | |
basic: | |
- match: '//' | |
scope: punctuation.definition.comment.example-c |
NewerOlder