Skip to content

Instantly share code, notes, and snippets.

View jhenry's full-sized avatar

Justin Henry jhenry

View GitHub Profile
@plembo
plembo / pandocdocx2md.md
Last active May 19, 2024 04:54
Convert docx to markdown with pandoc

Convert Word documents to markdown with pandoc

I use pandoc to convert masses of Word documents to markdown. Still working on a generic script, but for now here's the "gist" of what I type into the terminal:

$ myfilename="example"
$ pandoc \
-t markdown_strict \
--extract-media='./attachments/$myfilename' \
$myfilename.docx \
@kenmickles
kenmickles / Droplet.scpt
Last active December 29, 2022 07:33
AppleScript to SCP a file to a server and copy the path. Useful for sharing screenshots, etc.
use framework "Foundation"
use scripting additions
property scpTarget : "user@example.com:~/public_html/uploads"
property publicPath : "https://example.com/uploads/"
on open fileList
repeat with thisFile in fileList
set itemPath to the quoted form of the POSIX path of thisFile
do shell script ("scp " & itemPath & " " & scpTarget)
@adamreisnz
adamreisnz / package.json
Last active January 19, 2024 13:01
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@jonleung
jonleung / .sh
Created July 8, 2012 19:35
Extract Wunderlist DB
cd ~/Library/Wunderlist; sqlite3 -csv -header wunderlist.db "select * from tasks left join lists on tasks.list_id=lists.id;" > wunderlist_export.csv
@semperos
semperos / rspec-sinatra-modular.rb
Created April 20, 2012 17:21
Sinatra RSpec modular app
# Spec File 1
def app
FooApp
end
describe FooApp do
# for some reason, `app` resolves to the definition BarApp given in Spec File 2 below,
# instead of the above definition
...
end
@lmarburger
lmarburger / config.ru
Created August 30, 2011 03:38
Hack Showoff to remotely drive presentation
require "showoff"
require 'pusher'
Pusher.app_id = 'insert Pusher app id here'
Pusher.key = 'insert Pusher key here'
Pusher.secret = 'insert Pusher secret here'
class PresentationController
def initialize(app)
@app = app
@seancoyne
seancoyne / iChatGrowl.applescript
Created August 11, 2011 21:52
Applescript for iChat Growl (1.2.2) Notiifications
on notify_growl(theName, theTitle, theDescription, theImage)
tell application "GrowlHelperApp"
notify with name theName title theTitle description theDescription application name "iChat" image theImage
end tell
end notify_growl
using terms from application "iChat"
@duien
duien / gist:817421
Created February 8, 2011 22:33
Mongo Atlanta Notes

Tweet photo with #mongoatl to win!
Fur bus will shuttle back & forth to after-party, where there are 2 free drinks

Building an application with MongoDB

Will cover:

  • Data modeling, queries, geospacial, updates, map-reduce
  • Using location-based app as an example
%w[address_1 city state zip_code].each do |attr|
validates_presence_of attr, unless: ->(org) { org.send(attr).nil? }
end