Skip to content

Instantly share code, notes, and snippets.

View davidahopp's full-sized avatar

David Hopp davidahopp

View GitHub Profile

Keybase proof

I hereby claim:

  • I am davidahopp on github.
  • I am davidahopp (https://keybase.io/davidahopp) on keybase.
  • I have a public key ASADQSnQ-eBFU49xGoNE9i373tX7rdH7slCea8mcnH97TAo

To claim this, I am signing this object:

@davidahopp
davidahopp / psql_to_csv.sh
Last active August 28, 2023 19:14 — forked from sharmaeklavya2/psql_to_csv.sh
Export all tables including headers in a postgres database to a set of CSV files
#!/bin/bash
DB_NAME="$USER"
DBMS_SHELL="psql"
DBMS_USER="postgres"
#if [ "$1" = '--help' ]; then
if [[ ( "$1" == '--help' ) || ( "$1" == '-h' ) ]]; then
echo "usage: $0 [DB_NAME] [DBMS_SHELL]"
echo "default DB_NAME is your username"
class ApplicationController < ActionController::Base
before_filter :check_permissions
def check_permissions
redirect_to root_path unless current_user.beta_approved
end
end
class Ability
include CanCan::Ability
def initialize(user)
if user.beta_approved
can :view, :site
end
end
@davidahopp
davidahopp / gist:5417465
Last active December 16, 2015 10:08
This is a workaround for the issue reported here https://github.com/highslide-software/highcharts.com/issues/1551
var _this = this;
chart_options = {
chart:{},
plotOptions:{},
series:{
cursor: 'pointer',
point: {
events: {
click: function() {
// do your awesome magic here