Skip to content

Instantly share code, notes, and snippets.

View hjast's full-sized avatar

Reuben Doetsch hjast

View GitHub Profile
@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
@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
*/
object RooseveltIslandScript extends ImportScriptDSL {
import com.sportaneous.dataimport.common.Labels._
import JPAScalaBridge._
override def name = "roosevelt"
override val defaultCapacity = 5
@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(
@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 / 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 / Labels.scala
Created March 16, 2012 18:51
AImport.scala
object Labels {
//This is not used in MINDOBODY
//Induvidual Labels and sub cateogries
val hiking = getLabel("Hiking", TopLevelLabel.HIKING, "HIKING", true)
val swimming = getLabel("Swimming", TopLevelLabel.SWIMMING, "SWIMMING", true)
val running = getLabel("Running", TopLevelLabel.RUNNING, "RUNNING", true)
val baseball = getLabel("Baseball", TopLevelLabel.BASEBALL, "BASEBALL", true)
val basketball = getLabel("Basketball", TopLevelLabel.BASKETBALL, "BASKETBALL", true)
val cricket = getLabel("Cricket", TopLevelLabel.CRICKET, "CRICKET", true)
@hjast
hjast / gist:2051815
Created March 16, 2012 18:51
AImport.scala
* Follow this to write other gym import scripts. Import scripts will be faster than a GUI */
object JccImportScript extends ImportScriptDSL
{
import com.sportaneous.dataimport.common.Labels._
import JPAScalaBridge._
val locationID = 370000l
val cycling = getLabel("Cycling",TopLevelLabel.CYCLING,true)
val hiking = getLabel("Hiking",TopLevelLabel.HIKING,true)
val swimming = getLabel("Swimming",TopLevelLabel.SWIMMING,true)
val running = getLabel("Running",TopLevelLabel.RUNNING,true)
val baseball = getLabel("Baseball",TopLevelLabel.BASEBALL,true)
val basketball = getLabel("Basketball",TopLevelLabel.BASKETBALL,true)
val cricket = getLabel("Cricket",TopLevelLabel.CRICKET,true)
val football = getLabel("Football",TopLevelLabel.TOUCH_FOOTBALL,true)
val hockey = getLabel("Hockey",TopLevelLabel.HOCKEY,true)
val raquetball = getLabel("Raquetball",TopLevelLabel.RACKETBALL,true)
@hjast
hjast / gist:1676825
Created January 25, 2012 15:37
Returned
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
Crunch - Class Schedules
</title><meta http-equiv="Content-Type" content="text/xml; charset=UTF-8" /><meta http-equiv="pragma" content="no-cache" /><meta name="distribution" content="global" /><meta name="revisit-after" content="30 days" /></head>
<body>
<form name="form1" method="post" action="/PdfHandlers/ClassschedulesXML.aspx?facility=110" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMzQ1MDA4Mzk0ZGSrd5aUvXyb5qo57ejqtV7dFvTSMg==" />
</div>