Skip to content

Instantly share code, notes, and snippets.

View ianwinter's full-sized avatar

Ian Winter ianwinter

View GitHub Profile
@s3rvac
s3rvac / gcc-10-debian-buster.sh
Created October 31, 2020 10:39
Steps to build GCC 10 on Debian Buster.
#!/bin/bash
#
# Steps to build GCC 10 on Debian Buster.
#
set -e -x
# Install all dependencies.
export DEBIAN_FRONTEND=noninteractive
apt update
@merkushin
merkushin / mysql_uuid.sql
Last active October 15, 2023 14:06
MySQL UUID v5 Stored Functions
DROP FUNCTION IF EXISTS uuid_from_bin;
DROP FUNCTION IF EXISTS uuid_to_bin;
DROP FUNCTION IF EXISTS uuid_v5;
DROP FUNCTION IF EXISTS uuid_v4;
DELIMITER //
CREATE FUNCTION uuid_from_bin(b BINARY(16))
RETURNS CHAR(36)
BEGIN
@jesperronn
jesperronn / docx2md.md
Last active November 21, 2023 12:49 — forked from aembleton/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@aembleton
aembleton / docx2md.md
Last active May 17, 2023 07:04 — forked from vdavez/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@timblair
timblair / decoder.rb
Last active August 29, 2015 14:16
RFC 5322-compliant Message ID generator
require "date"
class MessageID
module Decode
STAMP_FIELD_FORMAT = "%Y%m%d%H%M%S%N"
def self.decode(id)
user, host = id.split("@")
parts = user.split(".").map { |part| part.to_i(36) }
stamp, ident = parts.shift, []
#!/usr/bin/env python
# Quick and dirty demonstration of CVE-2014-0160 by
# Jared Stafford (jspenguin@jspenguin.org)
# Modified so that it finds cookies
import sys
import struct
import socket
import time
import select
@timblair
timblair / git-merge-point
Created February 19, 2014 19:42
Show the point where a given commit was merged into master
#!/bin/bash
# Displays the point at which a given commit SHA was merged
#
# Usage: git merge-point SHA <TARGET>
TARGET=${2-master}
git rev-list --ancestry-path $1..$TARGET |
grep -f <(git rev-list --first-parent $1..$TARGET) |

This is an adaptation of https://twitter.com/jasonneylon script.

In the terminal window, you can open your current repo (at the current branch) in your default browser.

My adaptation was adding options to view the commits, branches, pull requests or issues for the repo using one of the additional options (added support for wiki, settings, pulse, graphs, network):

[h]               => View help
[c]               => View commits
[c {SHA}]         => View specific commit from commit SHA

[b] => View branches

@aliaspooryorik
aliaspooryorik / whitespace-bleed-finder.cfm
Last active December 30, 2015 11:19
Script to find missing or suspicious output attributes in components
<cfset folder = expandpath("./")>
<cfset warn = []>
<cfset alert = []>
<cfdirectory action="list" directory="#folder#" filter="*.cfc" recurse="true" name="cfcs" type="file">
<cfoutput>
<style>
@vdavez
vdavez / docx2md.md
Last active April 21, 2024 20:05
Convert a Word Document into MD

Converting a Word Document to Markdown in Two Moves

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

The Solution

As it turns out, there are several open-source tools that allow for conversion between file types. Pandoc is one of them, and it's powerful. In fact, pandoc's website says "If you need to convert files from one markup format into another, pandoc is your swiss-army knife." But, although pandoc can convert from markdown into .docx, it doesn't work in the other direction.