This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)#!/bin/bash | |
FILENAME=$1 | |
cd ~/veritas-podcast | |
#change ownership to bholt | |
sudo chown bholt ./record/${FILENAME}.wav | |
[ $? -eq 0 ] || exit $? |
This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.
Most the credit for these changes go to Dave Holland.
#!/bin/bash | |
# About: Bash script to create new Jekyll posts | |
# Author: @AamnahAkram | |
# URL: https://gist.github.com/aamnah/f89fca7906f66f6f6a12 | |
# Description: This is a more advanced version of the script which can | |
# - take options | |
# - has color coded status messages | |
# - improved code | |
# - lowercase permalinks | |
# - usage message |
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback | |
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB; | |
// Open (or create) the database | |
var open = indexedDB.open("MyDatabase", 1); | |
// Create the schema | |
open.onupgradeneeded = function() { | |
var db = open.result; | |
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"}); |
#!/usr/bin/env bash | |
######################################################################## | |
# Author: Joseph Nix [email protected] 6-18-2015 | |
# Copyright (c) 2015 Terminal Labs | |
# Distributed under the MIT License. | |
# (See http://opensource.org/licenses/MIT) | |
# | |
# This tests the average page load time for a given url. It can be set | |
# to run any number of tests, and then will average the results. | |
# |
To use: create a new bookmark and paste into the URL field. | |
In Chrome, you can paste the full multiline code as shown below. | |
In other browsers, you may need to minify the code into one line first. |
{# style 1 - long form #} | |
{% if filepath == '/var/opt/tomcat_1' %} | |
{% set tomcat_value = tomcat_1_value %} | |
{% else %} | |
{% set tomcat_value = tomcat_2_value %} | |
{% endif %} | |
{# style 2 - short form #} | |
{% set tomcat_value = tomcat_1_value if (filepath == '/var/opt/tomcat_1') else tomcat_2_value %} |
Step zero: Install this role by creating the directories roles/letsencrypt/
, roles/letsencrypt/files/
and roles/letsencrypt/tasks/
. Then save the tasks.yml
from this gist as roles/letsencrypt/tasks/main.yml
and config.sh
from this gist as roles/letsencrypt/files/config.sh
.
Step one: Add the following to your nginx server config
location /.well-known/acme-challenge {
root /var/www/letsencrypt;
}
Step two: Execute the ansible role, e.g. using