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 | |
# Extracting URLs from the exported HTML from getpocket.com/export | |
# In the following line $1 is the exported HTML from pocket | |
# Which will be passed to this script as a CLI parameter | |
# copied from https://gist.github.com/fmartingr/88a258bfad47fb00a3ef9d6c38e5699e?permalink_comment_id=4324412#gistcomment-4324412 | |
grep -Eoi '<a [^>]+>' $1 | tac > pocket2shiori.txt | |
# Reading the URLs one by one and adding to shiori, with tags, if they exist |
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
// REMAPPING CMD+SPACE TO RIGHT COMMAND USING https://github.com/tekezo/Karabiner-Elements | |
// Put following code into rules section into ~/.config/karabiner/karabiner.json file | |
// "profiles": [ | |
// ... | |
"rules": [ | |
{ | |
"description": "RightCommand to Switch Input Source", | |
"manipulators": [ | |
{ | |
"conditions": [ |
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 | |
# Remove backups older than a given days | |
TM_PATH=/Volumes/stuff0/Backups.backupdb/zeus | |
DAYS=60 | |
sudo find "${TM_PATH}" -maxdepth 1 -mtime +${DAYS} -type d -execdir tmutil delete '{}' \; | |
exit 0 |
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
# usage: | |
# say hello; notify #=> "Done" message will be sent on success and "Ooops" on error | |
# say hello; notify "in far far away galaxy" #=> "in far far away galaxy" message will be sent on success and "Ooops" on error | |
notify() { | |
local exit_code=$? | |
local api_key="PUT_API_KEY" | |
local chat_id="PUT_CHAT_ID_HERE" |
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
#!/usr/bin/env ruby | |
# | |
# Generate HTML report from CSV generated by TimeTracker.app | |
# Options: | |
# -i, --input - path to csv file | |
# -s, --start-time - report start time | |
# -e, --end-time - report end time (today by default) | |
# -p, --project - project name to include into report (all by default) | |
# -d, --delimiter - CSV delimiter ("," by default) | |
# -o, --out - directory to write report |
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
constraints(OwnDomain) do | |
match # ... | |
resources #... | |
end | |
class OwnDomain | |
def self.matches?(request) | |
request.subdomain.present? && request.subdomain != "www" && request.host !~ /localhost|\.local|hostname\.com/ | |
end | |
end |
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
search_for = '46846' | |
value = '00000' | |
stats = [] | |
search_for.size.times do |index| | |
stats[index] ||= [] | |
10.times do |digit| |
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
# This Rack middleware helps solving the issue with some Rails versions which do not accept | |
# a '*/*;q=0.6' and their variants 'Accept' request header. This header is particularly used | |
# by Google Bot, and if Rails doesn't like it, it will return a 500 or 406 error to Google Bot, | |
# which is not the best way to get your pages indexed. | |
# | |
# References: | |
# - http://stackoverflow.com/questions/8881756/googlebot-receiving-missing-template-error-for-an-existing-template | |
# - https://github.com/rails/rails/issues/4127 | |
# | |
class GoogleBotAware |
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
module FormattedDateAttributes | |
# Define virtual formatted date attribute | |
# | |
# formatted_date_attribute(:start_at, :end_at, :format => :default) | |
# formatted_date_attribute(:start_at, :end_at, :format => '%d/%m/%y') | |
# | |
# format parameter can be a symbol from config/initializers/date_time_formats.rb or any | |
# string format that will work with Date#strftime and DateTime.strptime methods | |
def formatted_date_attributes(*args) | |
options = { :format => :default }.merge(args.extract_options!) |
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
setopt autocd | |
setopt CORRECT | |
autoload -U compinit | |
compinit | |
#zmodload zsh/complist | |
zstyle ':completion:*' menu yes select | |
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} | |
zstyle ':completion:*:processes' command 'ps -xuf' |
NewerOlder