Skip to content

Instantly share code, notes, and snippets.

View wub's full-sized avatar

Jarrod Mosen wub

View GitHub Profile
@wub
wub / schema.txt
Created September 3, 2019 10:19
BQ Schema (Sparse)
----------------- ----------------------------------------------------------------------------------------------- ------------ ------------- ------------ ----------------------------- ------------------ --------
03 Sep 22:03:02 |- app_id: string 248096 333340368 DAY (field: derived_tstamp)
|- platform: string
|- etl_tstamp: timestamp
|- collector_tstamp: timestamp (required)
|- dvce_created_tstamp: timestamp
|- event: string
|-
@wub
wub / __.cr
Created July 6, 2019 06:59
New migration
class CreateJarrods::V20190706065802 < Avram::Migrator::Migration::V1
def migrate
create table_for(Jarrod) do
primary_key id : Int64
add_timestamps
end
end
def rollback
drop table_for(Jarrod)
@wub
wub / _.cr
Created July 6, 2019 06:56
Migration
class CreateUsers::V00000000000001 < Avram::Migrator::Migration::V1
def migrate
create :users do
add email : String, unique: true
add encrypted_password : String
end
end
def rollback
drop :users
<!DOCTYPE html>
<html>
<head></head>
<body>
<ul class="tabs">
<li data-display="foo">FOO</li>
<li data-display="bar">BAR</li>
<li data-display="baz">BAZ</li>
</ul>
// Usage
var forumURL = 'http://forums.com';
$('#discourse-latest-container').getDiscourseTopics(forumURL, 'latest');
// Fetch latest topics
(function($) {
jQuery.fn.getDiscourseTopics = function (url, page) {
if ($(this).exists()) {
$.getJSON(url + '/' + page + '.json', function (data) {
var topics = data.topic_list.topics,