Skip to content

Instantly share code, notes, and snippets.

View ayr-ton's full-sized avatar
⛩️
In the zone

Ayrton ayr-ton

⛩️
In the zone
  • Belo Horizonte
View GitHub Profile
@ayr-ton
ayr-ton / load_dotenv.sh
Last active April 4, 2022 18:08 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
function load-env() {
if [ -e .env ]
then
export $(cat .env | xargs)
echo ".env exported with success! 🥄"
else
echo "There's no spoon 🐲"
fi
}
#! /bin/bash
# Inspired on:
# http://www.thegameengine.org/miscellaneous/streaming-twitch-tv-ubuntu/
# https://wiki.archlinux.org/index.php/Streaming_to_twitch.tv
if [ ! -f ~/.twitch_key ]; then
echo "Error: Could not find file: ~/.twitch_key"
echo "Please create this file and copy past your stream key into it. Open this script for more details."
exit 1;
@ayr-ton
ayr-ton / rails.bat
Created October 8, 2016 00:06 — forked from diogolundberg/rails.bat
Workaround to Rails installer 3.2.0
@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"%~dp0ruby.exe" "%~dp0rails" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"%~dp0ruby.exe" "%~dpn0" %*

This is a very rough script to export your octopress files to Ghost. You will still need to check your data but it will give you a head start. Feel free to fork and optimize the script for your purpose.

The following should be considered:

  1. You need to execute the script in the source/_posts directory
  2. You need to manually copy all the images to /var/www/ghost/content/images
  3. Images with external URLs are not handled
  4. Blockquotes have their issues
  5. Lists are not exported correctly
--- ddclient.orig 2013-09-26 01:06:12.399990673 +0100
+++ ddclient 2013-09-26 06:25:36.768189452 +0100
@@ -13,12 +13,17 @@
# Support for multiple IP numbers added by
# Astaro AG, Ingo Schwarze <ischwarze-OOs/[email protected]> September 16, 2008
#
+# Modified to work with Cloudflare by Robert Ian Hawdon 2012-07-16: http://robertianhawdon.me.uk/
+#
+# Further modified to work with Cloudflare by Peter Roberts 2013-9-26, 2014-6-22: blog.peter-r.co.uk
+#
@ayr-ton
ayr-ton / 0_reuse_code.js
Created March 14, 2014 18:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console