This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script requires `curl` package to be installed. | |
# Replace `$APP_KEY` with the app key from your Scriptogr.am account below OR uncomment the line below and add the ID as a value to the variable. You can get the app key by adding your application on this page (when logged in): http://scriptogr.am/dashboard#developers | |
# $APP_KEY= | |
# Replace `$USER_ID` with the ID from your Scriptogr.am account below OR uncomment the line below and add the ID as a value to the variable. You can get your user ID from towards the bottom of this page (when logged in): http://scriptogr.am/dashboard#settings | |
# $USER_ID= | |
# Replace `$POST_NAME` with the name of the file containing the Markdown content of the post (minus the `.md` extension) OR uncomment the line below and add the extension-less filename as a value to the variable. | |
# $POST_NAME= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script requires `curl` package to be installed. | |
# Replace `$APP_KEY` with the app key from your Scriptogr.am account below OR uncomment the line below and add the ID as a value to the variable. You can get the app key by adding your application on this page (when logged in): http://scriptogr.am/dashboard#developers | |
# $APP_KEY= | |
# Replace `$USER_ID` with the ID from your Scriptogr.am account below OR uncomment the line below and add the ID as a value to the variable. You can get your user ID from towards the bottom of this page (when logged in): http://scriptogr.am/dashboard#settings | |
# $USER_ID= | |
# Replace `$POST_NAME` with the name of the file you want to remove (minus the `.md` extension) OR uncomment the line below and add the extension-less filename as a value to the variable. | |
# $POST_NAME= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit should go to http://stackoverflow.com/a/12607951/1563507 | |
# Move files into their own directories, using filenames without extensions. | |
die() { echo "$*" >&2; exit 1; } | |
for file in *.md; do # `md` used as example of filtering files one wants to move | |
dir=${file%.md} | |
test -d $dir || mkdir $dir # or just mkdir -p $dir | |
test -f $dir && die "$dir exists and is a file!" | |
mv $file $dir | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: ./autoscrp.sh [OPTION]... [FILE] | |
# Publish FILE to Scriptogr.am account (grabbing metadata as we go). | |
# FILE should have no extension. | |
# | |
# Expects metascrp.txt accompanying named file to pull metadata from. | |
# Expects there two text files in location of script, | |
# one containing app key for Scriptogram, | |
# the other containing the user ID. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in $(find * -maxdepth 0 -type d); do | |
newdirnm=${file:0:4}${file:5:2}${file:8:2}${file:11:2}${file:14:2}-${file:17} | |
mv $file $newdirnm | |
cd ./$newdirnm | |
git mv "$file".md "$newdirnm".md | |
git commit -m "Optimised filename for SEO." | |
cd .. | |
../autoscrp.sh $newdirnm | |
echo $newdirnm | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run in Node.js | |
var fs = require("fs"); | |
fs.readFile("./theme/main.html", { "encoding": "utf-8" }, function (err, data) { | |
if (err) return err; | |
var context_array = data.match(/\{\{(.*?)\}\}/g), | |
context_object = {}; | |
context_array.forEach((function (top_context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () { document.getElementsByClassName("waffle-objwrap-gvizchart")[0].style.overflow = "scroll"; } ()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run from within root folder. | |
# Check whether the file exists or not. | |
if [ -e $1 ] | |
then | |
re="([0-9]{12})\-(.*)\.md" | |
if [[ $1 =~ $re ]]; then | |
# Create date and time stamps and capture post filename. | |
datestamp=${BASH_REMATCH[1]:0:4}-${BASH_REMATCH[1]:4:2}-${BASH_REMATCH[1]:6:2} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
OlderNewer