Skip to content

Instantly share code, notes, and snippets.

View nickwynja's full-sized avatar

Nick Wynja nickwynja

View GitHub Profile
@nickwynja
nickwynja / gist:1664675
Created January 23, 2012 18:27
Markdown to HTML
set _me to "" & (path to me)
set AppleScript's text item delimiters to ":"
set packagePath to "" & text items 1 through -3 of _me
set AppleScript's text item delimiters to ""
set markdown to packagePath & ":Text Filters:markdown"
set smarty to packagePath & ":Text Filters:smartypants"
tell application "BBEdit"
run unix filter markdown with replacing selection
[blog@centos-test Blog]$ sudo /var/www/secondcrack/engine/update.sh /home/blog/Dropbox/Blog /var/www/secondcrack
PHP Warning: register_shutdown_function(): Invalid shutdown callback '' passed in /var/www/secondcrack/engine/update.php on line 20
[blog@secondcrack ~]$ sudo /home/blog/secondcrack/engine/update.sh /home/blog/Dropbox/Blog
## My output from update // "Expected filename mismatch:" leads me to believe I have something configured wrong? Not sure why it's working for you and not me.
/home/blog/secondcrack
Deleted file: /home/blog/Dropbox/Blog/drafts/test.txt
Expected filename mismatch:
filename: /home/blog/Dropbox/Blog/drafts/_publish-now/test.txt
expected: /home/blog/Dropbox/Blog/posts/2012/03/20120312-01-test.md
@nickwynja
nickwynja / gist:2433193
Created April 21, 2012 01:43
Instapaper Read Later Button for Second Crack
<iframe border="0" scrolling="no" width="78" height="17" style="float: right;" allowtransparency="true" frameborder="0" style="margin-bottom: -3px; z-index: 1338; border: 0px; background-color: transparent; overflow: hidden;" src="http://www.instapaper.com/e2?url=<?= $content['blog-url'].h($post['post-permalink-or-link']) ?>&title=<?= h($post['post-title']) ?>"
>
@nickwynja
nickwynja / gist:2502792
Created April 26, 2012 20:25
Create Scratchpad
set filename to "Scratchpad_" & short date string of (current date) & ".md"
set docsFolder to "Macintosh HD:Users:nickwynja:Dropbox:Documents:Scratchpad:"
set scratchpadPath to docsFolder & filename
tell application "Finder"
if exists file (docsFolder & filename) then
tell application "BBEdit"
activate
open (docsFolder & filename)
set _b to bounds of window 1
@nickwynja
nickwynja / gist:2503985
Created April 26, 2012 23:05
conical.ca CSS
#menu {
width: 960px;
height: 62px;
margin: 0 auto;
background: -webkit-gradient(linear, left top, left bottom, from(#FB9032), to(#EF7006));
background: -moz-linear-gradient(top, #FB9032, #EF7006);
border-radius: 22px;}
.post .meta {
height: 32px;

Perspectives

Perspectives let you filter out all the crap that's not relevant. The "Perspectives" menu bar is the main place to go. You can build your own using the View Bar (View > Show View Bar or shift-cmd-V), then Perspectives > Save Window As. There are some good tutorials to figure out Perspectives. I started with David Sparks's MPU screencasts

Active Projects

  • Project-based perspective
  • Shows only projects that have "available" tasks
  • Hides projects that a future-dated, repeating, etc
@nickwynja
nickwynja / gist:3064300
Created July 7, 2012 03:25
Brett Terpstra's Markdown Tweet Syntax
f.write(status.text + '\n\n')
f.write(theTime.strftime('[%B %d, %Y at %I:%M%p](http://twitter.com/'+status.author.screen_name+'/status/'+str(status.id)+')\n\n'))
f.write('--- \n\n')
{u'date': u'2012-08-07T00:04:08Z', u'posts': [{u'extended': u'', u'hash': u'12d2126ad032e43f3cdecdc927d511b9', u'description': u'Why does this simple php script leak memory? - Stack Overflow', u'tags': u'hm', u'href': u'http://stackoverflow.com/questions/1145775/why-does-this-simple-php-script-leak-memory', u'meta': u'b334d64c4df7cadb5503f7ff1bc13be4', u'time': u'2012-08-07T00:04:08Z', u'shared': u'yes', u'toread': u'no'}], u'user': u'nickwynja'}
@nickwynja
nickwynja / gist:3410329
Created August 21, 2012 01:26
Secondcrack Archive Case
<? if( $content['page-type'] != 'post' && $content['page-type'] != 'page' ){ ?>
<? if (isset($content['archives'])) { ?>
### Archive HTML Here ###
<? } ?>
<? } ?>