Skip to content

Instantly share code, notes, and snippets.

@vanrijn
vanrijn / meinosxsetbackground.py
Last active February 3, 2016 02:30
A simple python script to allow updating all of your desktop backgrounds, for all your screens/desktops/spaces at once.
#!/usr/bin/env python
# A simple python script to allow updating all of your desktop backgrounds,
# for all your desktops/spaces at once.
# Check out http://1klb.com/blog/desktop-background-on-os-x-109-mavericks.html
# for more information. His implementation was in Ruby. I wanted to do it
# in Python.
import sys
import os

Keybase proof

I hereby claim:

  • I am vanrijn on github.
  • I am vanrijn (https://keybase.io/vanrijn) on keybase.
  • I have a public key whose fingerprint is AFC4 7D68 F96E 554F F2A6 9461 79BA 58B4 CD40 A1E4

To claim this, I am signing this object:

on alfred_script(q)
set tmp to splitString(q, " ")
set q to item 1 of tmp
if length of tmp is 2 then
set change to item 2 of tmp
else
set change to 10
end if
@vanrijn
vanrijn / sublime_alignment.patch
Created February 6, 2013 02:04
Patch to sublime_alignment to place spaces at front of line instead of in the middle
diff --git a/Alignment.py b/Alignment.py
index dfcb1ca..e0b8158 100644
--- a/Alignment.py
+++ b/Alignment.py
@@ -43,6 +43,7 @@ class AlignmentCommand(sublime_plugin.TextCommand):
settings = view.settings()
tab_size = int(settings.get('tab_size', 8))
use_spaces = settings.get('translate_tabs_to_spaces')
+ add_mid_line_whitespace = settings.get('add_mid_line_whitespace')
@vanrijn
vanrijn / gist:4280623
Created December 13, 2012 22:24
Applescript to launch a new iTerm2 window
tell application "iTerm"
-- activate
-- Create a new terminal window...
set myterm to (make new terminal)
-- ... and go on within this one.
tell myterm
-- Set the terminal size constraints.
set number of columns to 80
- (void)methodWithFoo:foo
bar:bar
baz:baz
{
self.foo = foo;
self.bar = bar;
self.baz = baz;
}