Skip to content

Instantly share code, notes, and snippets.

View jkneal's full-sized avatar

Jerry Neal jkneal

  • Indiana University, The Kuali Project
  • Bloomington, IN
View GitHub Profile
@jkneal
jkneal / React Lookup
Last active August 29, 2015 14:07
Exploring how React components could be used to provide similar simple configuration (for lookups, inquiries, maintenance) for rapid screen creation
/**
* @jsx React.DOM
*/
var React = require('react');
var Lookup = require('./lookup.jsx');
var CourseLookup = React.createClass({
getInitialState: function () {
return {
// this could be expanded out to include any config necessary
@jkneal
jkneal / Demo
Created March 9, 2015 13:36
React Element Query
const React = require('react')
const {ElementQueryMixin} = require('../helpers/element-query')
require('./card.styl')
module.exports = {
title: 'Element Queries',
component: React.createClass({
@jkneal
jkneal / Current edit-course.jsx
Created March 30, 2015 18:42
Add onUpdate events to easy cursor
render():ReactElement {
var cid = this.getParams().cid
var config = this.config()
this.saveCourse(this.course().value) // We shouldn't do this on render. It also saves on window resize.
return (
<Layout cursor={this.cursor()} config={config} mode={EDIT}>
<EditOptions cid={cid}/>
</Layout>
)
@jkneal
jkneal / gist:154e9897e8afcd5f36d8
Created April 18, 2015 19:41
Training - JPA Converter
package train;
import java.awt.Color;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
@Converter
public class ColorConverter implements AttributeConverter {
var React = require('react/addons')
var Router = require('react-router')
var TestUtils = React.addons.TestUtils
var state = require('../../state')
var routes = require('../../routes')
var getIntlData = require('../../../../client/app/i18n/data')
var GroupsUsers = require('../../authed')
@jkneal
jkneal / NewApp.java
Last active September 25, 2015 13:30
Dept Inventory Search
private void setDepartmentInventoryResults(ClassDescriptionAdminInfo rv, ClassDescriptionAdminRequest request, AdminAcl acl) {
SisInstitution inst = request.getInstitution();
String car = request.getCar();
String strm = request.getStrm();
String subj = request.getSubj();
CatalogNumber catalogNumber = request.getCatalogNumber();
Map<String, Object> pd = new HashMap<>();
pd.put("inst", inst.name());
pd.put("car", car);
@jkneal
jkneal / deptinv.java
Created September 28, 2015 15:54
Inv Query
@Override
public List<ClassDeptDescriptionSearchResult> searchDepartmentDescriptions(
String inst, String car, String strm, String subj, String catalogNumber, String subjectLetter) {
List<String> classCriteria = new ArrayList<String>();
List<String> args = new ArrayList<String>();
classCriteria.add("a.institution = :1");
args.add(inst);
classCriteria.add("a.acad_career = :2");
args.add(car);
String matchSubj = subj;