Skip to content

Instantly share code, notes, and snippets.

View johnelm's full-sized avatar
💭
I may be slow to respond.

John Elm johnelm

💭
I may be slow to respond.
View GitHub Profile
/*
* Viktor's Roam Mobile Long tap to Exluce Filters and Right click on bullets + pages + title
* version: 0.3
* author: @ViktorTabori
*
* How to install it:
* - go to page [[roam/js]]
* - create a node with: { {[[roam/js]]}}
* - create a clode block under it, and change its type from clojure to javascript
* - allow the running of the javascript on the {{[[roam/js]]}} node
@johnelm
johnelm / README.md
Last active December 14, 2017 20:07
Sequence Tweaking Spock Extension

Sequence Tweaking Spock Extension

Quick and easy generation of int[] sequences for Codility and Leetcode algorithm challenge test cases

Recently I've been catching up on modern Java.. I haven't used it on the job since Java 5 came out. I've been practicing algorithms on Codility and Leetcode.

The algorithm puzzles on these sites almost always use int and/or int[] arguments and return types, and sometimes have BigO performance requirements. To test your algorithms properly, you need to generate very large input arrays, of sizes up to 100,000 with values from +/- 1 billion. My test cases weren't anywhere near as comprehensive as those run by Codility when you submit you solution, and I wanted a way to quickly create tests to cover edge cases and very large inputs.

I started using the data tables feature in the awesome Spock testing fram

@arturmkrtchyan
arturmkrtchyan / get_job_status.sh
Last active October 22, 2024 05:45
Apache Spark Hidden REST API
curl http://spark-cluster-ip:6066/v1/submissions/status/driver-20151008145126-0000
@phette23
phette23 / current-dir-in-iterm-tab-title.sh
Last active March 31, 2025 14:56
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@mreidsma
mreidsma / ArchiveandLogDone.scpt
Created April 17, 2012 03:38
Applescript to archive completed Taskpaper tasks to Google Calendar with ifttt.com
-- Archive completed Taskpaper tasks to Google Calendar with ifttt.com
-- First, set up the following recipe at ifttt.com to add completed tasks to your calendar:
-- http://ifttt.com/recipes/30256
--
-- Then use this Applescript to archive tasks. Mail.app needs to have the default account match your ifttt.com email
-- Let me know if you have any questions: [email protected] or @mreidsma
set archivedTasks to ""