Skip to content

Instantly share code, notes, and snippets.

@agsdot
agsdot / github_oauth.js
Created October 23, 2016 01:45 — forked from arb/github_oauth.js
Example hapi server using GitHub OAuth
var Hapi = require('hapi');
var Bell = require('bell');
var AuthCookie = require('hapi-auth-cookie');
var server = new Hapi.Server();
server.connection({ port: 9001 });
server.register([Bell, AuthCookie], function (err) {
if (err) {
@agsdot
agsdot / gist:1a24263835693fbd265f19e5ba1b1d1d
Created October 6, 2016 21:21 — forked from amandavisconti/gist:e909e41e6896d2a90de8
Setting up Annotator.js annotation on Drupal
Annotator.js works on Drupal as two modules and a library (installed, as usual, under /sites/all):
/modules/annotator
/modules/annotation
/libraries/annotator
The files in libraries/annotator are the latest from the Annotator.js repo (https://github.com/openannotation/annotator/releases). Although the modules Infinite Ulysses uses have been significantly changed from the modules you could download on Drupal.org, the Drupal.org Annotator (https://www.drupal.org/project/annotator) and Annotation (https://www.drupal.org/project/annotation) modules pages might still have useful info if you're troubleshooting.
Instructions:
I'll refer to the two modules as "Annotator" and "Annotation" throughout, and use "libraries/annotator" if I'm referring to the JS library.
1. Rename /libraries/annotator folder as just "annotator" and place in your sites/all/libraries folder (create a libraries folder there if you don't already have one).
@agsdot
agsdot / elixirphoenix.bash
Created September 25, 2016 21:46 — forked from likethesky/elixirphoenix.bash
Installing Elixir & the Phoenix framework with Homebrew on OS X
$ brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered!
$ brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it.
$ brew install elixir
$ mix local.hex # Answer y to any Qs
$ createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw...
# Use the latest Phoenix from here: http://www.phoenixframework.org/docs/installation -- currently this is 1.0.3
# ** Answer y to any Qs **
$ mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.0.3/phoenix_new-1.0.3.ez
@agsdot
agsdot / ask.sh
Created August 27, 2016 05:41
Bash: General-purpose Yes/No prompt function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# http://djm.me/ask
local prompt default REPLY
while true; do
@agsdot
agsdot / env.conf
Created August 7, 2016 02:22 — forked from ryenus/env.conf
/etc/systemd/system/elasticsearch.service.d/env.conf
[Service]
Environment=PATH=/opt/java/bin:/usr/local/sbin:/usr/local/bin:/usr/bin
Environment=ES_HOME=/usr/share/elasticsearch
Environment=ES_INCLUDE=/usr/share/elasticsearch/bin/elasticsearch.in.sh
@agsdot
agsdot / node-and-npm-in-30-seconds.sh
Created July 27, 2016 22:55 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@agsdot
agsdot / README.md
Created July 26, 2016 21:26 — forked from ichpuchtli/README.md
create_ap systemd service
@agsdot
agsdot / AddRepositoryToPacmanForYaourt
Created July 26, 2016 21:24 — forked from DenverDias/AddRepositoryToPacmanForYaourt
This snippet adds the repository to pacman that contains yaourt...
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
@agsdot
agsdot / osx-10.9-setup.md
Created June 28, 2016 21:01 — forked from kevinelliott/osx-10.9-setup.md
Clean Install – Mac OS X 10.9 Mavericks

Mac OS X 10.9 Mavericks

Custom recipe to get OS X 10.9 Mavericks running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install.

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Install from App Store

@agsdot
agsdot / Installing Drupal with drush
Created June 21, 2016 00:20 — forked from klan/Installing Drupal with drush
Step-by-step Drupal install with drush. Includes installation of: Omega theme (and sub-theme), Adminimal theme, Adminimal admin menu, Module Filter, Views, Context, ctools, Devel, Diff, Features, Entity API, Entity Reference, jQuery Update, Pathauto and Token.
› drush dl drupal --drupal-project-rename="projectname"
• Install site
› cd projectname/sites/all/modules/
› mkdir contrib custom
› drush dl adminimal_theme adminimal_admin_menu module_filter
› drush en -y adminimal_admin_menu module_filter
› drush variable-set admin_theme adminimal