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 /home/mviehweger/.rvm/wrappers/ruby-2.4.2/ruby | |
# frozen_string_literal: true | |
# http://trac.luon.net/data/ruby-dbus/tutorial/basic_client.html | |
# for ubuntu, there is d-feet | |
begin | |
require 'dbus' | |
rescue LoadError => e | |
require 'rbconfig' |
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
set folderPath to choose folder | |
set fileExtension to "opml" | |
tell application "Finder" | |
try | |
set the fileList to files of folderPath whose name extension is fileExtension | |
end try | |
end tell | |
tell application "/Applications/MindNode.app" | |
repeat with mindNodeFile in fileList | |
open (mindNodeFile as alias) |
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 Foundation | |
#if os(iOS) | |
import UIKit | |
#else | |
import AppKit | |
#endif | |
/// Return string value currently on clipboard | |
func getPasteboardContents() -> String? { |
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 | |
# Bash completion for `up` <http://brettterpstra.com/2014/05/14/up-fuzzy-navigation-up-a-directory-tree/> | |
_up_complete() | |
{ | |
local rx | |
local token=${COMP_WORDS[$COMP_CWORD]} | |
local IFS=$'\t' | |
local words=$(dirname `pwd` | tr / " ") | |
local nocasematchWasOff=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
# inspired by `bd`: https://github.com/vigneshwaranr/bd | |
function _up() { | |
local rx updir | |
rx=$(ruby -e "print '$1'.gsub(/\s+/,'').split('').join('.*?')") | |
updir=`echo $PWD | ruby -e "print STDIN.read.sub(/(.*\/${rx}[^\/]*\/).*/i,'\1')"` | |
echo -n "$updir" | |
} | |
function up() { | |
if [ $# -eq 0 ]; then |
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 | |
require 'yaml' | |
require 'fileutils' | |
class Folderize | |
def initialize(config_file=false) | |
config_file = File.expand_path("~/.folderize") unless config_file | |
# Set up config | |
unless File.exists?(config_file) |
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
@mixin hocus { | |
&:hover, | |
&:focus { | |
@content; | |
} | |
} | |
// Before | |
E { | |
&:hover, |
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 | |
# encoding: utf-8 | |
# tag primary folders =Tagname | |
# target them with #Tagname | |
# tag subfolders with @nickname | |
# target them with :nickname | |
# if no tagged folder exists but there's a matching folder name, that's used | |
# otherwise it will create folders based on :tags | |
# :tags can be strung together :bt:Drafts:testing for nesting | |
# Only one #Tag and one :path should exist in a file's tags |
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 | |
# encoding: utf-8 | |
SILENT = ENV['SL_SILENT'] =~ /false/i ? false : true || true | |
VERSION = '2.2.23' | |
# SearchLink by Brett Terpstra 2015 <http://brettterpstra.com/projects/searchlink/> | |
# MIT License, please maintain attribution | |
require 'net/https' | |
require 'uri' |
NewerOlder