Skip to content

Instantly share code, notes, and snippets.

View gregdaynes's full-sized avatar
Tech & Politics are intertwined. Everyone is welcome, your hate is not.

Gregory Daynes gregdaynes

Tech & Politics are intertwined. Everyone is welcome, your hate is not.
View GitHub Profile
@fractaledmind
fractaledmind / sqlite-statement-diagrams.rb
Created January 2, 2025 23:18
Skeleton of a Ruby SQLite parser that renders the syntax diagrams for all of the statements in plain text
# ┌──────{ , }◀─────┐
# ◯─┴┬─▶[ sql-stmt ]─┬┴─▶◯
# └───────▶───────┘
def sql_stmt_list
end
# ◯─┬─────────────┬▶─────────────────────┬─┬─▶[ alter-table-stmt ]──────────▶─┬▶◯
# └─{ EXPLAIN }─┴─▶{ QUERY }─▶{ PLAN }─┘ ├─▶[ analyze-stmt ]──────────────▶─┤
# ├─▶[ attach-stmt ]───────────────▶─┤
# ├─▶[ begin-stmt ]────────────────▶─┤
@marcoarment
marcoarment / S3.php
Last active July 8, 2025 17:39
A simple PHP class to perform basic operations against Amazon S3 and compatible services.
<?php
/*
A simple PHP class to perform basic operations against Amazon S3 and compatible
services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules.
Copyright 2022 Marco Arment. Released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@antfu
antfu / doc-table.md
Last active October 14, 2023 20:09
Doc Table in Markdown

Example

Name

Description


@mattmc3
mattmc3 / 1-setopts.zsh
Last active October 15, 2025 11:49
ZSH - options by framework
## ZSH Options
# http://zsh.sourceforge.net/Doc/Release/Options.html
# Changing Directories
# http://zsh.sourceforge.net/Doc/Release/Options.html#Changing-Directories
setopt auto_cd # if a command isn't valid, but is a directory, cd to that dir
setopt auto_pushd # make cd push the old directory onto the directory stack
setopt pushd_ignore_dups # don’t push multiple copies of the same directory onto the directory stack
setopt pushd_minus # exchanges the meanings of ‘+’ and ‘-’ when specifying a directory in the stack
@sdondley
sdondley / tmux split-window subcommand.md
Last active October 17, 2025 17:46
Super Guide to the split-window tmux Subcommand (and Beyond)

Super Guide to the split-window tmux Subcommand (and Beyond)

Guide overview

tmux, like other great software, is deceptive. On the one hand, it's fairly easy to get set up and start using right away. On the other hand, it's difficult to take advantage of tmux's adanced features without spending some quality alone time with the manual. But the problem with manuals is that they aren't geared toward beginners. They are geared toward helping seasoned developers and computer enthusiasts quickly obtain the

@tzmartin
tzmartin / embedded-file-viewer.md
Last active October 15, 2025 15:23
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@shauvik
shauvik / OpenAtomHere
Created June 12, 2014 18:06
AppleScript to open current Finder directory in Atom editor
(*
* Finder Open Atom Here - v1.0 - 6/12/2014
* http://shauvik.com/
*
* Copyright (c) 2014 Shauvik Roy Choudhary
* Dual licensed under the MIT and GPL licenses.
* Based on Open iTerm Here script by Ben Alman
*)
tell application "Finder"
@xaviervia
xaviervia / nginx-environment.md
Last active July 1, 2019 12:45
Nginx and Docker links with environment variables, a love story

How to add environment variables to nginx.conf

This is the hack approach to adding environment variables to the nginx configuration files. As with most Google results for this search, the reason is Docker.

The setup

I intended to deploy two Docker containers.

@rx
rx / zurb-ink-650.css
Last active February 6, 2016 11:02
Zurb Ink converted to 650px wide.
/**********************************************
* Ink v1.0.5 - Copyright 2013 ZURB Inc *
**********************************************/
/* Client-specific Styles & Reset */
#outlook a {
padding: 0;
}