Skip to content

Instantly share code, notes, and snippets.

View atomicules's full-sized avatar

atomicules atomicules

View GitHub Profile
@atomicules
atomicules / gist:884922
Created March 24, 2011 11:33
iTunes Script - Add Wishlist Item. Note that this information is probably out of date. It is being added here for reference/archival purposes and relates to a blog post from 2005
-- This script uses a dummy mp3 file (not supplied) to add a wishlist item to a specified playlist in your library.
-- Useful for when the track isn't available from the iTMS (and hence you can't drag this in as a wishlist item) and you want to remember to acquire it later from 'other sources'. You can use the dummy track in a playlist to act as a placeholder until you obtain it. I.e. to layout a running order, etc.
--
-- HOW TO USE
--
-- Use Quicktime to create a dummy mp3 file. Open a new player and just save as to create a mp3.
--Place the dummy file somewhere suitable, amend the path below
--Amend the wishlist playlist name if so desired
--This script (last time I checked) worked better when complied as an application, otherwise some Apple Event time out errors occur with the dialogs sometimes
--The script will prompt for a name, artist and album when run.

Keybase proof

I hereby claim:

  • I am atomicules on github.
  • I am atomicules (https://keybase.io/atomicules) on keybase.
  • I have a public key ASBni4NmxizXOetsZ-hSo_BsUcy1AgtbNdlY7YZT_8_9aAo

To claim this, I am signing this object:

@atomicules
atomicules / tw-13-2014-11-11.patch
Last active December 19, 2015 18:31
Patch for TW-13 in Taskwarrior
$ Patch for daylight savings time
--- src/recur.cpp.orig
+++ src/recur.cpp
@@ -215,6 +215,7 @@ ISO8601d getNextRecurrence (ISO8601d& current, std::string& period)
int m = current.month ();
int d = current.day ();
int y = current.year ();
+ ISO8601d recurrence_date;
// Some periods are difficult, because they can be vague.
diff --git a/sic.c b/sic.c
index d93c2ec..bc09eee 100644
--- a/sic.c
+++ b/sic.c
@@ -118,7 +118,7 @@ parsesrv(char *cmd) {
par = skip(cmd, ' ');
txt = skip(par, ':');
trim(par);
- if(!strcmp("PONG", cmd))
+ if(!strcmp("PONG", cmd) || !strcmp("QUIT", cmd) || !strcmp("JOIN", cmd))
@atomicules
atomicules / gist:5391599
Created April 15, 2013 21:55
An old half-finished Applescript where I was looking at automating a download of my pinboard bookmarks into Camino. Been quite a while since I used Camino - dated 2011.
-- pinboard username and password
property pbuser : ""
property pbpass : ""
--Download bookmarks via curl to desktop (because can use shortcut when selecting file for import via UI scripting)
do shell script ("cd ~/Desktop; curl https://" & pbuser & ":" & pbpass & "@pinboard.in/export/ -o pinboard.html")
--import bookmarks via UI scripting
tell application "System Events"
@atomicules
atomicules / snownews.patch
Created March 3, 2013 23:38
Small patch to snownews keybindings to provide more mutt like behaviour. Space does Enter in list view, but next page in reading view. You need to set appropriate user keybindings in conjunction with this patch.
---
interface.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/interface.c b/interface.c
index 6b28a51..78ca3c2 100644
--- a/interface.c
+++ b/interface.c
@@ -289,7 +289,7 @@ void UIDisplayItem (struct newsitem * current_item, struct feed * current_feed,
@atomicules
atomicules / libreimport.py
Created June 3, 2012 09:37
http://gitorious.org/fmthings/lasttolibre/blobs/master/libreimport.py Record of slight tweaks I've made to this to use the scrobble.log format
#!/usr/bin/python
#modified version of old import.py
# Lastscrape -- recovers data from libre.fm
# Copyright (C) 2009 Free Software Foundation, Inc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@atomicules
atomicules / gist:3487173
Created August 27, 2012 10:16
Diff file for patching and building STFL 0.22 on OSX 10.5.8 PPC
diff -crB stfl-0.22-orig/Makefile stfl-0.22/Makefile
*** stfl-0.22-orig/Makefile 2012-08-27 10:41:35.000000000 +0100
--- stfl-0.22/Makefile 2012-08-27 10:59:33.000000000 +0100
***************
*** 20,33 ****
include Makefile.cfg
- export CC = gcc -pthread
export CFLAGS += -I. -Wall -Os -ggdb -D_GNU_SOURCE -fPIC
@atomicules
atomicules / bad.R
Created November 20, 2011 14:05
R and data.table for loop bug/nuance. Code extract for embedding in a blog post
#Extract of R code
#This doesn't work properly
#Need to know how many levels
nl <- length(levels(datatable$Grouping))
#then how many per graph
ng = 8
#Can then loop
for (i in 1:ceiling(nl/ng)) {
@atomicules
atomicules / reference_for_pgfsweave-tikz_option.Rnw
Created November 20, 2011 13:45
Some Sweave file extracts for embedding in a blog post, showing different approaches for looping through Lattice plots for Sweave vs Tikz/pgfSweave
%Reference for pgfSweave / Tikz option
%Sweave file extract
\begin{figure}
<<fig=TRUE, tikz=T>>=
print(
xyplot(Y ~ Date | Grouping, datatable[levels(datatable$Grouping)[1:8]], layout=c(1,8), ylim=c(-100,100), xlim=as.Date(c("2011-01-01", "2011-07-01")) )
)
@
\end{figure}