Skip to content

Instantly share code, notes, and snippets.

View PendragonDevelopment's full-sized avatar
🏠
Working from home

Jordan Burke PendragonDevelopment

🏠
Working from home
View GitHub Profile
@stouset
stouset / LICENSE
Last active May 27, 2022 16:46
Best-practices based API key authentication
Copyright © 2021 Stephen Touset <stephen@touset.org>
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 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SO
@jwilson8767
jwilson8767 / install_WSL_docker.sh
Last active May 14, 2020 17:17
Docker Toolbox for Windows and Windows Subsystem for Linux (aka Bash on Windows)
#
# This script installs and configures WSL to work with Docker Toolbox for Windows.
# 1. Install WSL (check out [bowinstaller](https://github.com/xezpeleta/bowinstaller) for programmatic installation.
# 2. Run the contents of this script in Bash. (copy and paste works fine, no need to save)
#
sudo -sEH << 'EOM'
# Install the docker client and docker-compose
apt-get update && apt-get install -y curl ca-certificates
curl -sSL https://get.docker.com/ | sh
curl -L "https://github.com/docker/compose/releases/download/1.11.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@timdorr
timdorr / README.md
Created May 31, 2016 22:14
A basic Sidekiq rate limiter

Don't copypasta this!

Note that this is very purpose-built. The job args in particular depend on a unique key being in the first position.

There is also plenty of brittle code all over the place.

Instead, use this as a guide for how you might build your own. A lot of the parts are the same between implementations.

@chrissimpkins
chrissimpkins / gist:5bf5686bae86b8129bee
Last active March 6, 2023 00:10
Atom Editor Cheat Sheet: macOS

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
# The following is a quick and dirty example of uploading to vimeo using ruby
# It assumes that you already have an access token for a user
require 'net/http'
require 'httparty'
ACCESS_TOKEN = "your access token here"
auth = "Bearer #{ACCESS_TOKEN}"
# get ticket
@maban
maban / Event Notes.md
Last active March 9, 2020 19:28
Event Notes

Event Notes

  • Event Name:
  • Location:
  • Date:
  • Conference format: (number of days, tracks, and speakers)

Talk

@deepakkumarnd
deepakkumarnd / server_setup.sh
Last active April 3, 2020 15:14
Server setup script
# This script has to be run as a root user
echo "* Updating system"
apt-get update
apt-get -y upgrade
echo "* Installing packages"
apt-get -y install build-essential libmagickcore-dev imagemagick libmagickwand-dev libxml2-dev libxslt1-dev git-core nginx redis-server curl nodejs htop
id -u deploy &> /dev/null
if [ $? -ne 0 ]
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
@nathansmith
nathansmith / #1 manifest_time.rb
Last active December 15, 2015 11:49
Used to cache-bust <html manifest="..."> locally. Turns static when deployed.
# Used to cache-bust <html manifest="..."> locally
def manifest_time
t = Time.now
year = t.year
month = t.month
day = t.day
hour = t.hour
min = t.min
# Seconds changes too frequently for