Skip to content

Instantly share code, notes, and snippets.

View LBRapid's full-sized avatar
🏠
Working from home

John Dyer LBRapid

🏠
Working from home
View GitHub Profile
describe 'Scheduler Model', ->
describe 'when instantiated', ->
it 'should exhibit attributes', ->
scheduler = new Augury.Models.Scheduler count: '10', interval: 'days'
expect(scheduler.get('count')).toEqual('10')
<div class="field">
<label for="registration-keys">Keys</label>
<div class="error"></div>
<div class="select2-container select2-container-multi select2 fullwidth" id="s2id_registration-keys">
<ul class="select2-choices">
<li class="select2-search-field">
<input type="text" autocomplete="off" class="select2-input" style="width: 20px;">
</li>
</ul>
</div>
valid: (view, attr, selector) ->
element = view.$('[' + selector + '~="' + attr + '"]')
element.removeClass("invalid")
element.prev('div.error').html('')
view.$('fieldset .error-message').html('')
return true
buildEventKey: ->
eventKey = new Object()
$.each @$('.event-keys .row'), (index, value) =>
name = @$(value).find('input#name').first().val()
path = @$(value).find('input#path').first().val()
if path && name
eventKey[name] = path
eventKeyJSON = JSON.stringify(eventKey)
@$('.event-keys').append("<input id='registration-event-key' name='event-key' type='hidden' value='#{eventKeyJSON}' />")
@model.set(event_key: @$('input[name=event-key]').val())
" Copy gist link to clipboard
let g:gist_clip_command = 'pbcopy'
" ================ Statusline Settings =================
" Show the statusline all the time
set laststatus=2
" Useful status information at bottom of screen
set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %{exists('*CapsLockStatusline')?CapsLockStatusline():''}%=%-16(\ %l,%c-%v\ %)%P
use Rack::Runtime
use Rack::MethodOverride
use ActionDispatch::RequestId
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use ActionDispatch::DebugExceptions
use ActionDispatch::RemoteIp
use ActionDispatch::Reloader
use ActionDispatch::Callbacks
use ActionDispatch::Cookies
init = ->
$scope.pageTitle = "Edit Registration"
Registration.get({ id: $routeParams.id }).then (result) ->
$scope.registration = result
setKeys($scope.registration)
setKeys = (registration) ->
Registration.availableKeys().then (result) ->
$scope.availableKeys = result
init = ->
$scope.pageTitle = "Edit Registration"
$scope.registration = {}
Registration.get({ id: $routeParams.id }).then (result) ->
$scope.registration = result
setKeys($scope.registration)
setKeys = (registration) ->
Registration.availableKeys().then (result) ->
angular.module('AuguryAdmin').controller 'RegistrationsCtrl'
, ['$scope', '$location', 'Registration', 'SelectedRegistration', 'pageData'
, ($scope, $location, Registration, SelectedRegistration, pageData) ->
init = ->
$scope.registrations = Registration.query()
$scope.storeName = pageData.storeName
$scope.createRegistration = ->
$location.path '/new'