Skip to content

Instantly share code, notes, and snippets.

View sweinberg's full-sized avatar

swein sweinberg

View GitHub Profile
@ttscoff
ttscoff / ifttt-pocket_to_nvalt.rb
Created November 1, 2013 12:05
A Hazel script for converting IFTTT-saved Pocket favorites to nvALT notes
#!/usr/bin/env ruby
# Works with IFTTT recipe https://ifttt.com/recipes/125999
#
# Set Hazel to watch the folder you specify in the recipe.
# Make sure nvALT is set to store its notes as individual files.
# Edit the $target_folder variable below to point to your nvALT
# ntoes folder.
require 'date'
require 'open-uri'
require 'net/http'
@ttscoff
ttscoff / randommarkdown.rb
Created October 26, 2013 20:58
Generates a ton of Lorem Ipsum Markdown text for testing/filler purposes. Easily modifiable output.
#!/usr/bin/ruby
# Generates a bunch of random Markdown text (with footnotes/tables)
# REQUIREMENTS:
# raingrams gem ([sudo] gem install raingrams)
# a text file at ~/words/alice.txt containing lots of words
# I recommend using mine from http://ckyp.us/kZWQ
require 'rubygems'
require 'raingrams'
@epramono
epramono / NewListinClearFromLCP
Created October 14, 2013 15:16
This action allows you to use separate lines for each item that you want to add to a new list in Clear. If you want to add to an existing list, provide the existing list name in the first prompt. Requires: Clear 1.2 and Launch Center Pro 2.0.
clearapp://list/create?
listName=[prompt:List Name]&
tasks=[prompt-list:List Items]
@epramono
epramono / UploadPhotoAndTweetLink
Last active December 25, 2015 04:49
Upload the last photo in your Camera Roll to Dropbox and get the link pasted to your Tweetbot compose window. Requires: Tweetbot 1.4 and Launch Center Pro 2.0.
@mwhite
mwhite / git-aliases.md
Last active March 23, 2025 00:40
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@JoelBesada
JoelBesada / README.md
Last active October 14, 2022 04:20
Backtick Example Command

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
@ttscoff
ttscoff / short_titles.sh
Created August 29, 2013 02:19
Via @pilotmoon, the secret to shortening your popclip bar.
$ defaults write com.pilotmoon.popclip UseShortTitles -bool YES
$ killall PopClip && open -a PopClip
@cclauss
cclauss / tiltingColor.py
Last active December 21, 2015 18:48
A gravity hack that uses Pythonista's scene.gravity() method to change screen colors when the user tilts their device. Red = abs(pitch), Green = abs(yaw), Blue = abs(roll)
Moved to: https://github.com/cclauss/Pythonista_scene
@ttscoff
ttscoff / mmoutline2md.rb
Created August 22, 2013 14:37
Convert a Mindjet MindManager text outline export to Markdown
#!/usr/bin/env ruby
input = STDIN.read
input.gsub!(/^\=+\n ?(.*?)\n\=+/,"# \\1")
input.gsub!(/^-+\n\d+ (.*?)\n-+/,"## \\1")
input.gsub!(/^\d+\.\d+ (.*)/,"### \\1")
input.gsub!(/^\d+\.\d+\./,"@")
input.gsub!(/^@\d+ /,"- ")
input.gsub!(/^@\d+\.\d+ /,"\t- ")
@Neurogami
Neurogami / glitch.rb
Created August 12, 2013 04:56
Simple script to rin perfectly good image files.
#!/usr/bin/env ruby
=begin
Simple script to smack your glitch up.
Call this program with the name of an image file, and two numbers
The first number is used to determine when to mess with a byte in the
image file. If you pass in, say 2000, then even 2000th byte gets tweaked.