Skip to content

Instantly share code, notes, and snippets.

View ryanramage's full-sized avatar

Ryan Ramage ryanramage

View GitHub Profile
@ryanramage
ryanramage / UMD.js
Last active December 17, 2015 19:19
Make sure you replace FILLME with values.
(function (root, factory) {
if (typeof exports === 'object') {
module.exports = factory( require('FILLME_A'), require('FILLME_B'), require('FILLME_C'));
} else if (typeof define === 'function' && define.amd) {
define(['FILLME_A', 'FILLME_B', 'FILLME_C'],factory);
} else {
root.FILLME_GLOBAL_NAME = factory(root.FILLME_A, root.FILLME_B, root.FILLME_C);
}
}(this, function (FILLME_A, FILLME_B, FILLME_C) {
@ryanramage
ryanramage / howto.md
Created May 29, 2013 22:28
Kujua Lite - Hosted security settings.

Kujua Lite - Hosted security settings.

After installing an instance of Kujua-Lite, it is fairly easy to administer access to it. This document will explain how.

Goal

  • To ensure only members of the group 'organizationX' have access to an instance of kujua-lite.
@ryanramage
ryanramage / twitter-links.user.js
Created October 7, 2013 16:33
A chrome/greasemonkey script to replace twitter t.co links with the actual links.
@ryanramage
ryanramage / gist:7760588
Created December 2, 2013 22:55
CouchDB creates db after delete, when replication doc exists
{
"_id": "redforms-rwp-6566",
"_rev": "2-bb45ce4405f0d49e329d1f4511ceb142",
"source": "redforms",
"target": "redforms-rwp-6566",
"continuous": true,
"create_target": true,
"doc_ids": [
"_design/redforms"
],
@ryanramage
ryanramage / gist:9005948
Created February 14, 2014 18:08
Use a minified require, fallback to unminified if not available
<script type="text/javascript">
function load(){
require(['js/app', 'jquery'], function (app, $) {
window.$ = $;
app.initialize();
require(['js/libs/bootstrap'], function(ihatebs){})
});
}
function loadDev(){
console.log('DEVELOPMENT MODE');
@ryanramage
ryanramage / log.txt
Last active August 29, 2015 13:59
rcouch build
> git clone https://github.com/apache/couchdb.git
> cd couchdb/
> git checkout -b 1994-merge-rcouch origin/1994-merge-rcouch
> make
> make check
---skipping logs, to around the failures -----
oauth_users_db.js ... testing
oauth_users_db.js ... ok
@ryanramage
ryanramage / Dockerfile
Last active August 29, 2015 14:18
Example Dockerfile
FROM ryanramage/pm2-git-alpine
# Add source files & deps
ADD . /var/www/ui-widgets
WORKDIR /var/www/ui-widgets
# Define mountable directories.
VOLUME ["/var/log/ui-widgets"]
@ryanramage
ryanramage / package.json
Last active August 29, 2015 14:18
Example package.json using docker build run push
{
"name": "example",
"version": "2.1.4",
"description": "Example docker",
"scripts": {
"start": "node bin/cli",
"docker-build": "rm -rf node_modules && npm i --production && ./node_modules/docker-build-run-push/docker-build",
"docker-run": "./node_modules/docker-build-run-push/docker-run",
"docker-push": "rm -rf node_modules && npm i && make build && npm prune && ./node_modules/docker-build-run-push/docker-push"
},
@ryanramage
ryanramage / response.json
Created March 1, 2016 00:22
example listings
{
"took": 9,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 9063,
@ryanramage
ryanramage / form.js
Created July 14, 2016 15:36
Slackbot form for multi-user
#!/usr/bin/env node
const isPhone = require('is-phone')
const RtmClient = require('@slack/client').RtmClient
const MemoryDataStore = require('@slack/client').MemoryDataStore
const RTM_EVENTS = require('@slack/client').RTM_EVENTS
const token = process.env.SLACK_TOKEN || ''
const rtm = new RtmClient(token, {
logLevel: 'error',