Skip to content

Instantly share code, notes, and snippets.

View nickwynja's full-sized avatar

Nick Wynja nickwynja

View GitHub Profile
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
address 10.0.1.103
netmask 255.255.255.0
ofexport -E -a done=any -I -t "flagged or (started='to today')" -t "sort start" --tasks -o ~/Desktop/todo.html
<?
// Define this near the top of Post.php
public static $archive_page_template = 'archive.php';
/// Add this function to Post.php
public function write_archive($posts)
@nickwynja
nickwynja / gist:5760252
Last active April 9, 2017 17:26
Adding an archive page to Second Crack / Continental
<?php
/// Add this function to Post.php
public function write_archive($posts)
{
$template = Updater::$archive_page_template;
$t = new Template($template);
$t->content = array(
'post-title' => 'Archive',
@nickwynja
nickwynja / gist:5489113
Last active December 16, 2015 19:59
Copy Message URI
tell application "Mail"
set selectedMessages to selection
set theMessage to first item of selectedMessages
set messageid to message id of theMessage
-- Make URL (must use URL-encoded values for "<" and ">")
set urlText to "message://" & "%3c" & messageid & "%3e"
set the clipboard to (urlText)
end tell
@nickwynja
nickwynja / gist:5383723
Last active December 16, 2015 05:19
Looking for a way to only add the item to the end of the list (on line 14) if the item is NOT completed. No variation of the dictionaries `completed = false` seems to work.
tell application "OmniFocus"
set _items to {}
set _item to {}
set _task to {}
set _tasks to {}
tell the default document to tell the front document window
set perspective name to "Started"
set AllTrees to trees of content
repeat with i from 2 to count of AllTrees
set dTrees to descendant trees of item i of AllTrees
@nickwynja
nickwynja / gist:4120127
Created November 20, 2012 18:53
Export Campfire Chat Transcripts
import json
import pycurl
import sys
import time
import datetime
import os
## File Settings
filePath = '/Path/to/Dir/'
set filename to "scratchx-" & short date string of (current date) & ".md"
set docsFolder to "/Users/kevin/Dropbox/NOTES"
set scratchpadPath to docsFolder & filename
tell application "Finder"
if exists scratchpadPath as POSIX file then
tell application "TextEdit"
do shell script "open -a TextEdit " & (quoted form of (scratchpadPath))
end tell
set filename to "Scratchpad_" & short date string of (current date) & ".txt"
set docsFolder to "/Users/nickwynja/Dropbox/Documents/Notes/"
set scratchpadPath to docsFolder & filename
tell application "Finder"
if exists scratchpadPath as POSIX file then
do shell script "open -a Byword \"" & scratchpadPath & "\""
else
do shell script "touch " & scratchpadPath
do shell script "open -a Byword \"" & scratchpadPath & "\""
I have $2000 of credit debt on a CAN$ card at 12.9% interest.
I lose on exchange rate when I make payments in US$.
I could open a US$ credit card with 19.9% interest.
Which one is a better deal if I plan on it asking 6 months to pay off?