Skip to content

Instantly share code, notes, and snippets.

View hjast's full-sized avatar

Reuben Doetsch hjast

View GitHub Profile
@hjast
hjast / dabblet.css
Created March 17, 2012 15:16
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@hjast
hjast / stuff.scala
Created March 25, 2012 18:33
SyncedOrgInterface
//Readonly synced organization. For example Crunch, 24 hour fitness or any gym with a custom CRM solution will use this interface
/*
2 Ways to do this
1. The data source is very complicated and can not be broken down into it's respecitves facs/ class Types or activities.
2. The data source can be mapped to Synced Facilities, synced class types, and synced activities. If this route is taken it allows us to
perform some boilerplate code. (for example, sync all synced facility in parallel, then sync all class types in parallel, then sync all activity collection in parallel.
@hjast
hjast / formt.scala
Created March 26, 2012 14:13
Format
/* Follow this to write other gym import scripts. Import scripts will be faster than a GUI */
object TestOrgScript extends ImportScriptDSL {
import com.sportaneous.dataimport.common.Labels._
import JPAScalaBridge._
override def name = "test-org"
val reubenHouse = Facility(
object RooseveltIslandScript extends ImportScriptDSL {
import com.sportaneous.dataimport.common.Labels._
import JPAScalaBridge._
override def name = "roosevelt"
override val defaultCapacity = 5
@hjast
hjast / NamedCallableFunction.scala
Created August 27, 2012 01:24
NamedCallableFunction.scala
import net.liftweb.http.SHtml._
import ElemAttr._
import net.liftweb.util.Helpers._
object LiftExtensions {
/**This callable function creates a named function which takes a initialize obj and returns
* a json value which gets passed to the callback functions.
* @param name the name of the function
* @param func - the function which takes a json value and returns another json value to return to server
*/
@hjast
hjast / editFoo.js
Created August 27, 2012 01:43
EditFoo
editFoo({
foodentifer: $(this).attr("data-foo");
newStuffToAdd: {
facialHair: "mustache"
},
success: function(foo, status, xhr) {
alert("Foo has a new " + foo.facialHair) // Perhaps prints out "Foo has a new mustache"
//Or does something like keeps client + server side in sync after a update operations with a larger JSON payload.
//x and y actually also have information about the