Artem Chistyakov
Staff Engineer, Betterment
Website: https://temochka.com
Twitter: @artemchistyakov
This file contains hidden or 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
{ | |
"title": "Notes automations", | |
"rules": [ | |
{ | |
"description": "Launch Apple Notes automations in Alfred", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"conditions": [ | |
{ |
This file contains hidden or 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
#!/usr/bin/env ruby | |
while (path = gets) | |
filename = File.basename(path) | |
next if filename.start_with?('@') | |
filename.gsub(/\..+$/, '').split(/[_.]/).reject(&:empty?).each { |token| puts token } | |
end |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# pipe the following command into this script: | |
# git log --pretty=format: --name-only | most-changed-dirs | |
counts = Hash.new { |hash, k| hash[k] = 0 } | |
while (filename = gets) | |
next if filename.start_with?('@') | |
parts = filename.strip.split(File::SEPARATOR).reject(&:empty?) |
This file contains hidden or 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
var Safari = Application('Safari'); | |
var OmniFocus = Application('OmniFocus'); | |
var currentWindow = Safari.windows[0]; | |
var currentTab = currentWindow.currentTab(); | |
var task = OmniFocus.InboxTask({ name: currentTab.name(), note: currentTab.url() }); | |
OmniFocus.quickEntry.open(); | |
OmniFocus.quickEntry.inboxTasks.push(task); |
This file contains hidden or 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
(defn eval-expr [max-sum [sum sequence stack] lexeme] | |
(case lexeme | |
"[" [sum (conj sequence "(") (cons ")" stack)] | |
"]" [sum (conj sequence ")") (next stack)] | |
(let [x (Integer/parseInt lexeme)] | |
(if (<= (+ sum x) max-sum) | |
[(+ sum x) (conj sequence lexeme) stack] | |
(reduced [sum (concat sequence stack) nil]))))) | |
(defn horribilis [max-sum program] |
This file contains hidden or 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
(ns cursive-test) | |
(defn $render-digest | |
[{{{accept "accept"} :headers} :request | |
{:keys [date-range]} ::request | |
record ::entry}] | |
(let [digest (apply db/get-digest-data record date-range)] | |
(if (re-matches #"^application/json;?.*" accept) | |
(json/generate-string digest) | |
(ring-response {:headers {"Cache-Control" "max-age=0, private, no-cache, no-store, must-revalidate" |
This file contains hidden or 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
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE NamedFieldPuns #-} | |
module Main where | |
import Control.Monad | |
import Network.HTTP.Simple | |
import Network.HTTP.Client.TLS | |
import System.Environment | |
import System.Exit |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'timeout' | |
abort "Usage: #{$0} <file> [duration] [rps]" unless ARGV.size >= 1 | |
filename, duration, rps = ARGV | |
duration = (duration || 5).to_i | |
rps = (rps || 100).to_i | |
pause = 1.0 / rps |
NewerOlder