I recently had to write a quick script to update a text file full of pdf annotations. I wrote the script in Ruby then I wondered how much of a difference in speed I would get if I turned it into Crystal. See below.
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
#! python3 | |
# smwtimer2.py - A simple countdown script. | |
# Using datetime | |
import time, datetime | |
from subprocess import call | |
call(["ls", "-l"]) | |
pomStart = datetime.datetime.now() | |
pomTime = datetime.timedelta(minutes=25) |
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 "tumblr_client" | |
require "time" | |
require "yaml" | |
require "fileutils" | |
require "open-uri" | |
require "nokogiri" | |
require "loofah" | |
require "reverse_markdown" |
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
{ | |
"~f" = "moveWordForward:"; /* M-f */ | |
"~b" = "moveWordBackward:"; /* M-b */ | |
"~w" = (selectWord:); | |
// select entire line/paragraph | |
"@L" = (selectParagraph:); | |
// select from beginning of paragraph to last character | |
"@l" = (moveToBeginningOfParagraph:, moveToEndOfParagraphAndModifySelection:); | |
// bookmark | |
"~1" = (setMark:); |
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
# Copyright (c) 2009 rupa deadwyler. Licensed under the WTFPL license, Version 2 | |
# maintains a jump-list of the directories you actually use | |
# | |
# INSTALL: | |
# * put something like this in your .bashrc/.zshrc: | |
# . /path/to/z.sh | |
# * cd around for a while to build up the db | |
# * PROFIT!! | |
# * optionally: |
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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": false, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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
/* | |
Requires: | |
- pi-gpio | |
- gpio-admin | |
This snippet is intended to be the hello world equivalent for working | |
with the raspberry pi gpio with node.js. This simply flashes an LED | |
connected to pin 7 based on the duration. | |
*/ |
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
export EDITOR=nvim | |
export PATH=$PATH:$HOME/.fzf/bin | |
export ZSH_AUTOSUGGEST_USE_ASYNC=true | |
source $HOME/.zsh/antigen.zsh | |
# Load the oh-my-zsh's library. | |
antigen use oh-my-zsh | |
# Bundles from the default repo (robbyrussell's oh-my-zsh). |
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
# Copyright (c) 2009 rupa deadwyler. Licensed under the WTFPL license, Version 2 | |
# maintains a jump-list of the directories you actually use | |
# | |
# INSTALL: | |
# * put something like this in your .bashrc/.zshrc: | |
# . /path/to/z.sh | |
# * cd around for a while to build up the db | |
# * PROFIT!! | |
# * optionally: |
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
-- AppleScript -- | |
-- This example is meant as a simple starting point to show how to get the information in the simplest available way. | |
-- Keep in mind that when asking for a `return` after another, only the first one will be output. | |
-- This method is as good as its JXA counterpart. | |
-- Google Chrome | |
tell application "Google Chrome" to return title of active tab of front window | |
tell application "Google Chrome" to return URL of active tab of front window | |
-- Google Chrome Canary |