This file contains 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
data class Animal( | |
val name: String | |
) | |
data class Farm( | |
val animals: List<Animal> = emptyList(), | |
) |
This file contains 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 TRIGGER test_trigger_insert_update AFTER UPDATE OR INSERT ON inventory FOR EACH ROW EXECUTE PROCEDURE record_inventory_change(); | |
CREATE TRIGGER test_trigger_delete BEFORE DELETE ON inventory FOR EACH ROW EXECUTE PROCEDURE record_inventory_change(); |
This file contains 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 | |
record_inventory_change() | |
RETURNS TRIGGER LANGUAGE plpgsql AS $$ | |
DECLARE | |
columns text; | |
entity RECORD := NEW; | |
_deleted VARCHAR(5) := 'false'; | |
BEGIN | |
SELECT string_agg(column_name, ',') INTO columns from information_schema.columns where table_name = 'inventory'; | |
IF TG_OP = 'DELETE' THEN |
This file contains 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 TABLE inventory_audit AS TABLE inventory WITH NO DATA; | |
ALTER TABLE inventory_audit ADD COLUMN _deleted BOOLEAN DEFAULT FALSE; | |
ALTER TABLE inventory_audit ADD COLUMN audit_id SERIAL PRIMARY KEY; | |
ALTER TABLE inventory_audit ADD COLUMN _created_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; | |
CREATE INDEX idx_inventory_audit_id ON inventory_audit (id); |
This file contains 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 TABLE inventory ( | |
id SERIAL PRIMARY KEY, | |
item VARCHAR(255) NOT NULL, | |
price INTEGER NOT NULL, | |
created_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
updated_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP | |
); |
This file contains 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
import time | |
i = 0 | |
while True: | |
i += 1 | |
print("ping" if i % 2 else "pong") | |
time.sleep(0.5) |
This file contains 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
screen /dev/tty.usbmodem14301 115200 |
This file contains 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
ls /dev/tty.* |
This file contains 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
<h2>This week's parties!</h2> | |
These parties are all in/close to <%= @user.profile.location %> - because you set your Speakeasy profile's location to there. | |
<br>You can change your location by <%= link_to "updating your profile", edit_profile_url(:subdomain => 'www') %>. | |
<br> | |
<% | |
# List events at top of email | |
day = nil | |
@locations.each do |location| | |
event = location.event |
This file contains 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
// | |
// Stripe.m | |
// Stripe | |
// | |
// Created by Saikat Chakrabarti on 10/30/12. | |
// Copyright (c) 2012 Stripe. All rights reserved. | |
// | |
#import "STPAPIConnection.h" | |
#import "Stripe.h" |
NewerOlder