This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// assets param is either a plain js object or an array of plain js objects | |
_merge(assets) { | |
// If parameter is a single object, make it an array | |
assets = Array.isArray(assets) ? assets : [assets]; | |
// From object(s), create an ordered map of id => record | |
let newAssets = new OrderedMap(assets.map(asset => [asset.id, new Asset(asset)])); | |
// Merge in new assets, keeping old if new is equal (same values) to preserve reference equality | |
this._assets = this._assets.mergeWith((prev, next) => prev.equals(next) ? prev : next, newAssets); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Trak-It Web App</title> | |
<script src="//maps.google.com/maps/api/js?v=3&sensor=false"></script> | |
<link rel="stylesheet" href="static/styles.css"> | |
</head> | |
<body id="modal-tag"> | |
<div id="app" class="content"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('appSettings', function() { | |
var profile = "default"; | |
var configSelections = { | |
"DataRate": "500SPS", | |
"TestAmp": "1x(VREFP-VREFN)/2.4mV", | |
"TestFreq": "fclk/2^21", | |
"PDRefBuf": 1, | |
"EnableLOFF": "LOFF Disabled", | |
"COMP_TH": "95%", | |
"ILEAD_OFF": "6nA", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Image < ActiveRecord::Base | |
belongs_to :snippet | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local all postgres trust | |
local all nathan peer | |
local all all md5 | |
# TYPE DATABASE USER ADDRESS METHOD | |
# "local" is for Unix domain socket connections only | |
local all all peer | |
# IPv4 local connections: | |
host all all 127.0.0.1/32 md5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PlaceSerializer < ActiveModel::Serializer | |
attributes :id, :foo, :bar, :features | |
def features | |
feature | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Editing {{.Title}}</h1> | |
<form action="/save/{{.Title}}" method="POST"> | |
<div> | |
<textarea name="body" cols="80" rows="20">{{printf "%s" .Body}}</textarea> | |
</div> | |
<div> | |
<input type="submit" value="Save"> | |
</div> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ServiceElement < ActiveRecord::Base | |
attr_accessible :body, :title, :category, :source, :number, :file | |
has_many :parts | |
has_many :presentations, through: :parts, order: "presentations.date" | |
end | |
class Part < ActiveRecord::Base | |
attr_accessible :position, :presentation_id, :service_element_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'on signup page' do | |
before { visit '/signup' } | |
let(:submit) { "Create Account" } | |
context "with invalid information" do | |
# tests here work great | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION reset_sequence(tablename text) RETURNS "pg_catalog"."void" AS $$ | |
DECLARE | |
BEGIN | |
RAISE NOTICE 'Resetting sequence for %...', tablename; | |
EXECUTE 'SELECT setval(''' || tablename || '_id_seq'', (SELECT MAX(id) FROM ' || tablename || '))'; | |
RAISE NOTICE 'Sequence reset.'; | |
END; |