Skip to content

Instantly share code, notes, and snippets.

View siayi's full-sized avatar
💭
I may be slow to respond.

Ayi Sumarna siayi

💭
I may be slow to respond.
View GitHub Profile
@siayi
siayi / md2wp
Created September 19, 2017 03:19 — forked from Gen2ly/md2wp
Convert Markdown to Wordpress blogging format
#!/bin/bash
# Convert Markdown to Wordpress blogging format
# Required program(s)
req_progs=(ascii2uni pandoc)
for p in ${req_progs[@]}; do
hash "$p" 2>&- || \
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }
done
@siayi
siayi / process.sh
Created September 25, 2017 11:10 — forked from d6y/process.sh
Batch convert HTML to Markdown
#!/bin/bash
# Converts HTML from https://exportmyposts.jazzychad.net/ exports to Markdown
POSTS_DIR=/Users/richard/Desktop/d6y/posts
for file in $POSTS_DIR/*.html
do
echo $file
@siayi
siayi / md_to_rst.sh
Created September 25, 2017 11:27 — forked from hugorodgerbrown/md_to_rst.sh
Shell script for converting a batch of *.md files into *.rst using pandoc.
# This script was created to convert a directory full
# of markdown files into rst equivalents. It uses
# pandoc to do the conversion.
#
# 1. Install pandoc from http://johnmacfarlane.net/pandoc/
# 2. Copy this script into the directory containing the .md files
# 3. Ensure that the script has execute permissions
# 4. Run the script
#
# By default this will keep the original .md file
@siayi
siayi / fix_windows.bat
Created August 16, 2018 05:02 — forked from harrisonlingren/fix_windows.bat
A script to fix Windows 10 shit
@rem *** Disable Some Service ***
sc stop DiagTrack
sc stop diagnosticshub.standardcollector.service
sc stop dmwappushservice
sc stop WMPNetworkSvc
sc stop WSearch
sc config DiagTrack start= disabled
sc config diagnosticshub.standardcollector.service start= disabled
sc config dmwappushservice start= disabled
@siayi
siayi / argparse.bat
Created August 16, 2018 05:03 — forked from sgryjp/argparse.bat
Command line option (argument) parsing example for Windows batch file.
:: Command line option (argument) parsing example
::
:: Written by Suguru Yamamoto
:: <https://gist.github.com/sgryjp/045989b0f6f0089a24f257d74b8a60bd>
:: LICENSE: Public Domain
@echo off
setlocal enableextensions
:: Parse arguments
set _LEVEL=0
@siayi
siayi / gh-compare.md
Created October 31, 2018 14:37 — forked from lehnerpat/gh-compare.md
GitHub Compare view

GitHub's compare view is available at:

https://github.com/$USER/$REPO/compare/$REV_A...$REV_B

Naturally, $USER and $REPO are the owner (user/organization) and repository names, respectively.

$REV{A,B} are the two sides of the compare view; they can either be a ref in $USER's repository, i.e. the name of a branch, tag or a commit SHA, or it can be a ref in $OWNER's fork of the repository by using the format $OWNER:$REF.

You can get a diff or patch for the result of the compare view by appending .diff or .patch to the URL, respectively.

@siayi
siayi / Clone-Github-Wiki-Pages.sh
Created October 26, 2020 23:31 — forked from hanxue/Clone-Github-Wiki-Pages.sh
Cloning Github Wiki Pages
hanxue-mac:Github hanxue$ git clone https://github.com/AppScale/appscale.wiki.git
Cloning into 'appscale.wiki'...
remote: Counting objects: 1745, done.
remote: Compressing objects: 100% (1733/1733), done.
remote: Total 1745 (delta 1089), reused 10 (delta 4)
Receiving objects: 100% (1745/1745), 267.93 KiB | 35.00 KiB/s, done.
Resolving deltas: 100% (1089/1089), done.
Checking connectivity... done
hanxue-mac:Github hanxue$ ls appscale.wiki/
.git/
@siayi
siayi / github-wiki-how-to.md
Created October 26, 2020 23:32 — forked from subfuzion/github-wiki-how-to.md
GitHub Wiki How-To

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: git@github.com:myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo. This wiki repo is distinct from any clone of the project repo (the repo without wiki.get appended).

How do I add images to a wiki page?

@siayi
siayi / wxr.py
Created October 27, 2021 18:39 — forked from chrono-meter/wxr.py
#!/usr/bin/env python3
from xml.etree import ElementTree
from pathlib import Path
import io
import datetime
import email.utils
__author__ = 'chrono-meter@gmx.net'
__version__ = '1.0.0'
__license__ = 'Python Software Foundation License'
@siayi
siayi / wordpress_export-post-data.php
Created October 27, 2021 18:40 — forked from robinnorth/wordpress_export-post-data.php
WordPress: Simple, configurable script to export post data to a CSV file
<?php
/**
* Export WordPress post data to CSV
* Based on <http://stackoverflow.com/a/3474698> and <http://ran.ge/2009/10/27/howto-create-stream-csv-php/>
*/
/**
*********************************************************************
* Configuration
*********************************************************************