Skip to content

Instantly share code, notes, and snippets.

View jploudre's full-sized avatar

Jonathan Ploudre jploudre

View GitHub Profile
@jploudre
jploudre / gist:7695046
Created November 28, 2013 17:04
Bash Script to rename files based on the first line
#!/bin/bash
for file in *
do
# Avoid renaming diretories!
if [ -f "$file" ]
then
newname=`head -1 $file`
if [ -f "$newname" ]
then
@jploudre
jploudre / gist:8065863
Created December 21, 2013 05:36
Autohotkey ternary
sub := (command1 = "#a") ? "add"
: (command1 = "#b") ? "build"
: (command1 = "#c") ? "change"
: (command1 = "#d") ? "down"
: (command1 = "#e") ? "unten"
: (command1 = "#f") ? "find"
: (command1 = "#i") ? "info"
: (command1 = "#j") ? "join"
: (command1 = "#k") ? "kill"
: (command1 = "#l") ? "locate"
@jploudre
jploudre / gist:11105143
Last active August 29, 2015 14:00
Find files and use pandoc
find . -name \*.md -type f -exec pandoc -o {}.txt {} \;
would run pandoc on all files with a .md suffix, creating a file with a .md.txt suffix.
(You will need a wrapper script if you want to get a .txt suffix without the .md,
or do ugly things with subshell invocations.) {} in any word from -exec to the
terminating \; will be replaced by the filename.
@jploudre
jploudre / gist:f1ed929ea151cb9663a8
Created June 23, 2014 03:16
Next Appointment Date (MEL)
Discuss at upcoming visit on {fn VisitDate () {local r, Appt=getfield(APPT_NEXT(),",","")
remove(Appt,2,5)
r=str(Appt)
return r}}{VisitDate()}.
@jploudre
jploudre / shellhook.ahk
Created December 6, 2015 15:57
Shell hook for window open
#Persistent
SetBatchLines, -1
Process, Priority,, High
Gui +LastFound
hWnd := WinExist()
DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
@jploudre
jploudre / macroanalysis.txt
Created December 7, 2015 00:28
Day One Macro Analysis in Launch Center Pro
dayone://post?entry=[prompt: This Macro's Title]%20--%20Analysis%0D%0A%0D%0A%7CAnalysis%7C%7C%0D%0A%7C:---%7C:---%7C%0D%0A%7CWhat%20would%20it%20do?%7C[prompt: What this would do]%7C%0D%0A%7CWill%20I%20use%20this%20in%20a%20year?%7C[list: Will I use this in a year?|★☆☆☆☆☆☆ Very Improbable|★★☆☆☆☆☆ Improbable|★★★☆☆☆☆ Somewhat Improbable|★★★★☆☆☆ Neither Probable or Not|★★★★★☆☆ Somewhat Probable|★★★★★★☆ Probable|★★★★★★★ Very Probable]%7C%0D%0A%7CIs%20this%20important%20for%20others/patients?%7C[list: Is this important for others?|★☆☆☆☆☆☆ Very Unimportant|★★☆☆☆☆☆ Unimportant|★★★☆☆☆☆ Somewhat Unimportant|★★★★☆☆☆ Neutral|★★★★★☆☆ Somewhat Important|★★★★★★☆ Important|★★★★★★★ Very Important]%7C%0D%0A%7CXCKD%20Save%20Time?%7C[list: Will this save time overall?|Yes|No]%7C%0D%0A%23MacroAnalysis
@jploudre
jploudre / closewindow.ahk
Created December 8, 2015 18:41
Automatically Close Window with Autohotkey
#Persistent
SetTimer, ClosePopup, 250
return
ClosePopup:
WinClose, Hummingbird Room - Super Turbo
return
; Key Parts of Ghoster Script
#SingleInstance,Force
SetBatchLines,-1
SetWindelay,0
OnExit,QUIT
START:
Gosub,READINI
Gosub,TRAYMENU
{MEL_SEND_FLAG("Flag", user.loginname ,"N", ADDDATES(str(._TODAYSDATE),"0","0","21"),"FIT Test status?","Has FIT been returned?","Documents", "")}
Patient given FIT card.
@jploudre
jploudre / SimpleHTML
Created March 5, 2017 17:42
Simple Inline CSS
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0"/>
<title>Even Better Motherfucking Website</title>
<meta name="description" content="It's even more fucking perfect than the others motherfucking websites."/>
<link rel="canonical" href="http://evenbettermotherfucking.website"/>
<style>
body {margin: 5% auto; background: #f2f2f2; color: #444444; font-family: "Hoefler Text", Georgia,Palatino,serif; font-size: 16px; line-height: 1.6; max-width: 73%;}