Skip to content

Instantly share code, notes, and snippets.

@jamiefolsom
jamiefolsom / harvard-marc21-to-elasticsearch.md
Last active January 20, 2021 18:23 — forked from jprante/harvard-marc21-to-elasticsearch.md
Ingest Harvard Library Bibliographic Dataset into Elasticsearch (as raw unmapped MARC21 fields)

HOWTO

Ingest Harvard Library Bibliographic Dataset into Elasticsearch (as raw unmapped MARC21 fields)

This HOWTO is for Linux systems (Windows is very similar)

  • install Java 8 into /usr/java/jdk1.8.0
  • install Elasticsearch 1.1.0
class Membership < ActiveRecord::Base
belongs_to :user
belongs_to :memberable, polymorphic: true
end
module Memberable
extend ActiveSupport::Concern
included do
has_many :memberships, as: :memberable, dependent: :destroy
has_many :users, through: :memberships
@jamiefolsom
jamiefolsom / gist:ce6afa2a1ea7cb8fd691
Created February 29, 2016 21:23 — forked from antoviaque/gist:8423488
Granting superuser privileges to an existing user in edX
edxapp@edx:~/edx-platform$ ./manage.py lms shell --settings=devstack
Python 2.7.3 (default, Sep 26 2013, 20:03:06)
Type "copyright", "credits" or "license" for more information.
IPython 0.13.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
@jamiefolsom
jamiefolsom / wp-config.php
Created September 14, 2012 21:19 — forked from micahwalter/wp-config.php
wp-config for mamp and phpfog
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@jamiefolsom
jamiefolsom / jquery.ba-tinypubsub.js
Created August 14, 2012 16:33 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@jamiefolsom
jamiefolsom / demo.htm
Created June 8, 2012 16:42 — forked from bennadel/demo.htm
Cross-Origin Resource Sharing (CORS) AJAX Requests Between jQuery And Node.js
<!DOCTYPE html>
<html>
<head>
<title>Cross-Origin Resource Sharing (CORS) With jQuery And Node.js</title>
</head>
<body>
<h1>
Cross-Origin Resource Sharing (CORS) With jQuery And Node.js
</h1>
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');