Skip to content

Instantly share code, notes, and snippets.

View dylan-k's full-sized avatar

Dylan Kinnett dylan-k

View GitHub Profile
@dylan-k
dylan-k / html2md-with-pandoc.sh
Created February 12, 2014 04:20 — forked from bzerangue/html2md-with-pandoc.sh
RECURSIVELY Bash convert all your html to markdown files (with Pandoc)
find . -name "*.ht*" | while read i; do pandoc -f html -t markdown "$i" -o "${i%.*}.md"; done
# a simpler method
# e.g. convert all text files in the current directory into a single .html file
pandoc *.txt > _book2.html
#My 'palabra' project contains similar examples
#!/usr/bin/ruby
# Sifttter: An IFTTT-to-Day One Logger by Craig Eley 2014 <http://craigeley.com>
# Based on tp-dailylog.rb by Brett Terpstra 2012 <http://brettterpstra.com>
#
# Notes:
# * Uses `mdfind` to locate a specific folder of IFTTT-generated text files changed in the last day
# * The location of your folder should be hardcoded in line 53
# * Scans leading timestamps in each line matching today's date
# * Does not alter text files in any way
# * Changes ampersand ('&') to 'and' so the script keeps running
@dylan-k
dylan-k / portraits-landscapes-notes.md
Last active August 29, 2015 14:08
portraits and landscapes note

To decide whether the chapbook is "ready" or not, I read through every poem in the manuscript and for each I assigned a value of "yes", "no", or "maybe". Here are the results. I would like to replace the pieces marked "no" with others that are more similar to the pieces marked "yes".

yes (5)

Beautiful Mannequins                                        09
Ghost City                                                  14
The New World                                               18

Walls 27

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@dylan-k
dylan-k / story.md
Last active August 29, 2015 14:14
example of a markdown file for experiments learning to convert markdown to PDF, using a LaTeX document class.
title author wordcount date
Document Title
Firstname Lastname
1000
2015-01-24

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec gravida quis augue in tincidunt. Ut pulvinar ac sapien venenatis dignissim. Fusce vulputate congue dui, at dictum risus congue vel. Vivamus rutrum commodo nunc, sed elementum velit consectetur nec. Aenean sit amet tellus non nisi vulputate ornare. Vestibulum in nibh cursus, volutpat leo in, auctor lacus. Donec euismod suscipit nunc sed tempus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper est in erat efficitur congue. Integer ullamcorper ac lorem non maximus. Aliquam ut placerat nisl, eget euismod ante.

Section 1

@dylan-k
dylan-k / install-sage.sh
Last active August 29, 2015 14:19
steps i took to install and use the Sage theme for Wordpress
# grab a copy of Sage from github
$ git clone --depth=50 --branch=master git://github.com/roots/sage.git roots/sage
# move into the directory where Sage was installed
$ cd roots/sage
$ npm install -g bower gulp jscs # Sage tests include the install for jscs this way. docs don't mention it.
# now check to ensure that you have the requirements installed, with prerequisite versions
# optional: $ composer --version
$ php -v && node -v && gulp -v && bower -v
# you should have:
# PHP >= 5.4.x (test uses 5.6.5)
@dylan-k
dylan-k / delete-blank-lines
Created August 1, 2013 19:08
Sublime Text 2: How to delete blank/empty lines
Select the text
Press Ctrl + H (or click Find->Replace)
Make sure you have selected 'regular expression' (press Alt + R)
Find what: ^\n
Replace With: (nothing, leave in blank)
@dylan-k
dylan-k / display-modified-time.php
Created August 1, 2013 21:09
Wordpress: Display Modified Time For example, if you posted an article on July 19, 2009, and you found out three days later that there was an update to the story. You can just edit the article, and it will show July 22, 2009 at the timestamp for last update. First you need to open these three files: index.php single.php page.php
<!--Then you will need to locate the following code -->
<?php the_modified_time('F jS, Y');?>
<!--Note: Since there are so many formats of displaying dates, you might not see the exact code, but something along this line.
Replace it with:-->
<?php $u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
@dylan-k
dylan-k / filenames.txt
Created September 1, 2013 01:36
use windows command prompt to generate a list of filenames
1) Drop to DOS prompt (Start->Run; cmd) or shift-rightclick to "open cmd prompt here"
2) Change to the directory you wish to get a text-based file listing (via cd commands)
3) Run “dir *.* /b >fileListing.txt“
/b puts the directory listing into “Bare Mode”–
@dylan-k
dylan-k / splitfiles.md
Last active December 22, 2015 19:09
split one text file into many

if you want to split one text (or html or similar) file into many, here's a trick:

split -p '^plop' file.txt newfile-

...will split file.txt whenever a line starts with 'plop', into files with names like newfile-a, newfile-b, newfile-c, and so on...

I'd love to get it to create numbered files, instead of lettering them a, b, c for extra credit, I'd love to change the filename to be the first line of text