Skip to content

Instantly share code, notes, and snippets.

View drewgates's full-sized avatar

Drew Gates drewgates

View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 15, 2024 20:11
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@syntaqx
syntaqx / cloud-init.yaml
Last active May 19, 2024 09:25
cloud init / cloud config to install Docker on Ubuntu
#cloud-config
# Option 1 - Full installation using cURL
package_update: true
package_upgrade: true
groups:
- docker
system_info:
@calebcgates
calebcgates / vim_commands.txt
Last active November 1, 2016 21:28
Vim Commands
:set number
:set autoindent
:set tabstop=4
:imap jj <Esc>
v /word Enter //begin visual select and select until first occurance of word
0 // beginning of line
gm // go to middle
gg // go to bottom
G // go to top
@duck1123
duck1123 / ddate.js
Created September 25, 2015 03:51
DDate in JS
// title: Discordian Date Converter
// filename: ddate.js
// author: Lord Anas Mystosis Nebuchadnezzar XXXVII
// URL: http://kronkltd.net/
// Format Key:
// d - Day of the month, 2 digits with leading zeros (01 - 73)
// D - A textual representation of a day, three letters (Swt, Bmt, Pun, Pri, Set)
// F - A full textual representation of a month (Chaos, Discord, Confusion, Bureaucracy, Aftermath)
// j - Day of the month without leading zeros (1 - 73)
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@vjt
vjt / copy-from-time-machine.sh
Last active March 8, 2024 17:05
Copy data from a Time Machine volume mounted on a Linux box.
#!/bin/bash
#
# Copy data from a Time Machine volume mounted on a Linux box.
#
# Usage: copy-from-time-machine.sh <source> <target>
#
# source: the source directory inside a time machine backup
# target: the target directory in which to copy the reconstructed
# directory trees. Created if it does not exists.
#
@LeonB
LeonB / serve.sh
Created July 30, 2012 21:03
One-line bash http server
:;while [ $? -eq 0 ];do nc -vlp 8080 -c'(r=read;e=echo;$r a b c;z=$r;while [ ${#z} -gt 2 ];do $r z;done;f=`$e $b|sed 's/[^a-z0-9_.-]//gi'`;h="HTTP/1.0";o="$h 200 OK\r\n";c="Content";if [ -z $f ];then($e $o;ls|(while $r n;do if [ -f "$n" ]; then $e "<a href=\"/$n\">`ls -gh $n`</a><br>";fi;done););elif [ -f $f ];then $e "$o$c-Type: `file -ib $f`\n$c-Length: `stat -c%s $f`";$e;cat $f;else $e -e "$h 404 Not Found\n\n404\n";fi)';done
@jterrace
jterrace / xvfb
Created June 11, 2012 18:46
xvfb init script for Ubuntu
XVFB=/usr/bin/Xvfb
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset"
PIDFILE=/var/run/xvfb.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)