Skip to content

Instantly share code, notes, and snippets.

@knewter
knewter / Main.elm
Last active January 27, 2024 01:43 — forked from hoelzro/Main.elm
Bug in elm-lang/core `Dict.merge`?
module Main exposing (..)
import Html.App as App
import Html exposing (Html, text)
import Dict exposing (Dict)
type alias Model =
()
@knewter
knewter / Comments.md
Last active June 15, 2016 19:04 — forked from billyboozer/Comments.md
Issue with compiling react native
@knewter
knewter / gist:4b50ec39187affdedce7
Last active January 11, 2016 18:32 — forked from adamrobbie/gist:f821f3c95e4a3185c4c2
HRFlow discussion
My current understanding of the process..
- 1 upload excel
- 2 hrflow creates form collector and a set of participant flows
- 3 form collector sends emails to participants with a link to the appropriate HRFORM
- upon completion of the partiicpant form, HRForms uses the completionURL to let us know
- if they have a spouse (unsure from the weird payload how this is deteremined, marriage status etc), we should send an email to the spouse with another HRForm url
- JOSH: (we should get this from marriage status - I was checking for spouse email I think?)
- upon that completion we'll receive another post to our submitform endpoint and fetch the data again and send the event along to the participant flow.
- eventually we want the participant fsm to complete with a signed boolean, unsure when this is determined as from the code this is assumed to happen.
- JOSH: This happens when we get their data back at all at present, if there is no spouse. if there is a spouse, this happens when we get the spouse's
require 'pry'
require 'net/http'
#require 'rexml/document'
#include REXML
class SamlSend
def initialize
end
@knewter
knewter / balls.coffee
Last active December 12, 2015 08:08 — forked from rclements/gist:4741481
$ ->
$.get '/lol/get_data', (data) ->
load_chart = new Highcharts.Chart
chart:
renderTo: 'graph'
defaultSeriesType: 'line'
title:
text: 'Per Diem'
xAxis:
title: 'Time'
it "issues credits to a student" do
@amount = BigDecimal("500.00")
@teacher.expects(:main_account_name).with(@school).returns(@teacher_account_name)
@credit_manager.expects(:transfer_credits).with("Issue Credits to Student", @teacher_account_name, @student_account_name, @amount).once
@credit_manager.issue_credits_to_student(@school, @teacher, @student, @amount)
end
7 def main_account_name(school)
8 "TEACHER#{id} MAIN SCHOOL#{school.id}"
9 end
10
11 def unredeemed_account_name
12 "TEACHER#{id} UNREDEEMED"
13 end
14
15 def undeposited_account_name
16 "TEACHER#{id} UNDEPOSITED"
# Generates the link to determine where the site bar switch button returns to.
def site_bar_switch_link(html_options = {})
admin? ? admin_switch_link(html_options) : frontend_switch_link(html_options)
end
def admin_switch_link(html_options = {})
link_to t('.switch_to_your_website', site_bar_translate_locale_args),
session[:website_return_to] || refinery.root_path(:locale => (Refinery::I18n.default_frontend_locale if Refinery.i18n_enabled?)),
html_options
end
class WorkUnit
scope :on_estimated_ticket, lambda{ include(:ticket).where("tickets.estimated_hours IS NOT NULL AND tickets.estimated_hours > 0") }
end
def project_completion_metric(project)
work_unit_hours_array = Array.new # Empty array to work with
# Take the summation of estimated_hours on a ticket from the project
estimated_hours = Ticket.for_project(project).sum(:estimated_hours)
@knewter
knewter / work.rb
Created January 12, 2012 17:24 — forked from rthbound/work.rb
Hot products
PartNumber.ordered_between(7.days.ago, Time.zone.now)
class PartNumber
named_scope :ordered_between, lambda{|start_time, end_time| { :conditions => ["orders.created_at BETWEEN ? AND ?", start_time, end_time], :include => [:order] }
end