Skip to content

Instantly share code, notes, and snippets.

View brandon-beacher's full-sized avatar
💭
🦑

Brandon Beacher brandon-beacher

💭
🦑
View GitHub Profile
@brandon-beacher
brandon-beacher / example-usage.php
Created November 9, 2018 21:20
Link Headers in PHP
$link = new Link();
$link->hub('https://example.com/websub/hub');
$link->self('https://example.com/myself');
$link->next('https://example.com/myself?page=2');
$link->__toString();
// <https://example.com/websub/hub>; rel="hub", <https://example.com/myself>; rel="self", <https://example.com/myself?page=2>; rel="next"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--Created by yFiles for HTML 2.1.0.2-->
<graphml xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml.html/2.0/ygraphml.xsd " xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:demostyle="http://www.yworks.com/yFilesHTML/demos/FlatDemoStyle/1.0" xmlns:bpmn="http://www.yworks.com/xml/yfiles-for-html/bpmn/2.0" xmlns:demotablestyle="http://www.yworks.com/yFilesHTML/demos/FlatDemoTableStyle/1.0" xmlns:uml="http://www.yworks.com/yFilesHTML/demos/UMLDemoStyle/1.0" xmlns:compat="http://www.yworks.com/xml/yfiles-compat-arrows/1.0" xmlns:VuejsNodeStyle="http://www.yworks.com/demos/yfiles-vuejs-node-style/1.0" xmlns:y="http://www.yworks.com/xml/yfiles-common/3.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/3.0" xmlns:yjs="http://www.yworks.com/xml/yfiles-for-html/2.0/xaml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<key id="d0" for="node" attr.type="boolean" attr.name="Expanded" y:attr.uri="h

Keybase proof

I hereby claim:

  • I am brandon-beacher on github.
  • I am brandon_beacher (https://keybase.io/brandon_beacher) on keybase.
  • I have a public key whose fingerprint is B997 F416 1CF0 E367 B30D CBD9 FB19 C8D0 973A 91E7

To claim this, I am signing this object:

var Bluebird = require("bluebird");
var GoogleCalendarQueue = require.main.require("./workers/lib/queue")("google_calendar_queue");
var Thinky = require("../../thinky");
var GoogleCalendarEventUpsertion = require("../../google/calendar/event_upsertion");
var Log = require("./log").namespace({ operation: "events_initialization" });
function GoogleCalendarEventsInitialization(googleCalendarId) {
var googleCalendarEvent;
var Google = require("googleapis");
var r = require("../../rethink");
var AuthClient = require("../auth/client");
var GoogleAccount = require("../../models/google/account");
function GoogleCalendarClient(googleAccountId) {
var authClient = AuthClient.create();
var googleAccount;
@brandon-beacher
brandon-beacher / gist:0b684f471a4e279dc77e
Last active July 22, 2016 11:59
left outer join in RethinkDB using javascript syntax
r.db("gather").table("contacts").filter({Company: "yiq5yon7"}).concatMap(function(contact) {
return r.db("gather").table("accounts").getAll(contact("Account").default("")).coerceTo("array").do(function(accounts) {
return r.branch(
accounts.isEmpty(),
[ { left: contact, right: null } ],
accounts.map(function(account) {
return { left: contact, right: account }
})
);
});
update events
set reminded = all_invitees.all_reminded
from (
select all(reminded) as all_reminded
from invitees
where invitees.event_id = events.id) as all_invitees
@brandon-beacher
brandon-beacher / gist:11378122
Created April 28, 2014 17:10
sublime text preferences
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
class User < ActiveRecord::Base
has_many :administered_customers, through: :customer_administrations, source: :customer
has_many :administered_districts, through: :district_administrations, source: :district
has_many :administered_schools, through: :school_administrations, source: :school
has_many :assigned_schools, through: :school_assignments, source: :school
has_many :classroom_teachings
has_many :customer_administrations
has_many :school_administrations
has_many :district_administrations