Skip to content

Instantly share code, notes, and snippets.

View kardeiz's full-sized avatar

Jacob Brown kardeiz

View GitHub Profile
@kardeiz
kardeiz / gist:7812863
Created December 5, 2013 20:02
Rails controller boilerplate - since I can never find it online
class TestsController < ApplicationController
# GET /tests
# GET /tests.json
def index
@tests = Test.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @tests }
end
@kardeiz
kardeiz / ad_utils.rb
Created November 2, 2013 00:29
Active Directory utility class
require 'net/ldap'
module AdHelper
class Connector
NO_LOGON_HOURS = '0' * 168
def initialize
config_file = Dir.glob("#{Rails.root}/config/**/ad.yml").first
@kardeiz
kardeiz / dcpromo_unattend.txt.erb
Last active December 27, 2015 05:29
Chef Windows Server 2008 recipe
[DCINSTALL]
SafeModeAdminPassword=<%= @admin_password %>
RebootOnCompletion=Yes
ReplicaOrNewDomain=domain
NewDomain=forest
NewDomainDNSName=<%= @domain_name %>
ForestLevel=3
DomainLevel=3
InstallDNS=yes
@kardeiz
kardeiz / desc.md
Last active December 24, 2015 16:59
  1. User visits web application.

    • User can view resource availability as unauthenticated user (availability recorded in web app database).
  2. User logs in to web application.

    • User information is authenticated against library SIP2 server:
      • On failure: user is prompted to re-enter information
      • On success:
        • User's supplementary information (e.g., name) is added to web app database (unless exists). Password (PIN) is not saved to web app database.
        • User account is created in ActiveDirectory (unless already exists). AD password is created from user's PIN (all information passed over SSL). Group and logon hours set to none.
@kardeiz
kardeiz / resume.md
Last active December 18, 2015 02:09
Résumé

Jacob Brown

[email protected]
214/223-1654


EDUCATION

M.S., Information Science (Digital Imaging). University of North Texas. December 2011. (4.0 GPA.)

@kardeiz
kardeiz / README.md
Last active December 11, 2015 14:09 — forked from mbostock/.block

This stacked area chart is constructed from a TSV file storing the market share of several popular web browsers over the last year. Data is from Clicky Web Analytics. The chart employs conventional margins and a number of D3 features:

@kardeiz
kardeiz / gist:4514649
Created January 11, 2013 22:49
blah js for later
<html>
<head>
<title>Charts</title>
<!-- <script src="../assets/d3.v2.js"></script> -->
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="../assets/sankey.js"></script>
<script src="../assets/jquery-1.8.3.min.js"></script>
<script src="../assets/underscore.js"></script>
<script src="../assets/underscore.nest.js"></script>
<script src="../assets/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.js"></script>
@kardeiz
kardeiz / marc2dspacedc.xsl
Last active December 13, 2017 16:50
Convert MARCXML to collection of DSpace Dublin Core nodes (for dublin_core.xml)
<?xml version="1.0" encoding="UTF-8"?>
<!-- Derived from imlsdcc.grainger.uiuc.edu/docs/stylesheets/GeneralMARCtoQDC.xsl -->
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
<xsl:template name="subfieldSelect">
<xsl:param name="codes"/>
<xsl:param name="delimeter">
<xsl:text> </xsl:text>
</xsl:param>
<xsl:variable name="str">
<xsl:for-each select="marc:subfield">
@kardeiz
kardeiz / gist:4355671
Last active December 10, 2015 01:08
catalog js
(function(){
if (typeof jQuery=='undefined') {
var headTag = document.getElementsByTagName("head")[0];
var jqTag = document.createElement('script');
jqTag.type = 'text/javascript';
jqTag.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js';
jqTag.onload = (function(){ myJQueryCode(jQuery); });
headTag.appendChild(jqTag);
} else {
@kardeiz
kardeiz / README.md
Created December 20, 2012 16:27 — forked from mbostock/.block

Switch between stacked and grouped layouts using sequenced transitions! Animations preserve object constancy and allow the user to follow the data across views. Animation design by Heer and Robertson. Colors and data generation inspired by Byron and Wattenberg.