This is a set of instructions to setup a Django Nginx Gunicorn MySQL/Postgres stack on a single Amazon EC2 instance.
const { CredentialProviderChain } = require('aws-sdk'); | |
const AWS = require('aws-sdk'); | |
const accountProvider = require('./account-provider'); | |
let getEnv = function(accountId) { | |
// TODO: insert logic to get your desired profile name | |
return profileName; | |
}; | |
let getProvider = async (accountId, mode) => { |
I've been fiddling about with an idea lately, looking at how higher-kinded types can be represented in such a way that we can reason with them in Rust here and now, without having to wait a couple years for what would be a significant change to the language and compiler.
There have been multiple discussions on introducing higher-ranked polymorphism into Rust, using Haskell-style Higher-Kinded Types (HKTs) or Scala-looking Generalised Associated Types (GATs). The benefit of higher-ranked polymorphism is to allow higher-level, richer abstractions and pattern expression than just the rank-1 polymorphism we have today.
As an example, currently we can express this type:
- Related Setup: https://gist.github.com/hofmannsven/6814278
- Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
- Interactive Beginners Tutorial: http://try.github.io/
- Git Cheatsheet by GitHub: https://services.github.com/on-demand/downloads/github-git-cheat-sheet/
This gist has been moved to its own Github repo, so it's easier to contribute with additions and corrections. Please open a PR there if you see any mistake, I don't track comments on here as there's no notification system for gists AFAIK. Thanks.
Function | Shortcut |
---|---|
Previous Tab | ⌘ + Left Arrow |
Next Tab | ⌘ + Right Arrow |
Go to Tab | ⌘ + Number |
# Licensed under MIT. | |
# Copyright (2016) by Kevin van Zonneveld https://twitter.com/kvz | |
# | |
# This Makefile offers convience shortcuts into any Node.js project that utilizes npm scripts. | |
# It functions as a wrapper around the actual listed in `package.json` | |
# So instead of typing: | |
# | |
# $ npm script build:assets | |
# | |
# you could just as well type: |
Graphic via State of Florida CFO Vendor Payment Search (flair.myfloridacfo.com)
This is a quick command I use to snapshot webpages that have a fun image I want to keep for my own collection of WTFViz. Why not just right-click and save the image? Oftentimes, the webpage in which the image is embedded contains necessary context, such as captions and links to important documentation just incase you forget what exactly that fun graphic was trying to explain.
#!/usr/bin/env python | |
import subprocess | |
import argparse | |
import os | |
import sys | |
def yesno(message_type, default = 'y'): | |
if message_type == 'DELETE_FILES_IN_FOLDER': | |
question = 'The folder is not empty. Do you want to delete the files in it?' |