Internal ID | Color | Label | Gradient |
---|---|---|---|
205488546921017 | #ff7ca8 |
Candy | #ff8fb2 #a797ff #00e5ff |
370940413392601 | #1adb5b |
Citrus | #ffd200 #6edf00 #00dfbb |
164535220883264 | #f01d6a |
Berry | #005fff #9200ff #ff2e19 |
930060997172551 | #ff9c19 |
Mango | #ffdc2d #ff9616 #ff4f00 |
417639218648241 | #0edcde |
Aqua | #19c9ff #00e6d2 #0ee6b7 |
196241301102133 | #0084ff |
Default Blue | N/A |
1928399724138152 | #44bec7 |
Teal Blue | N/A |
174636906462322 | #ffc300 |
Yellow | N/A |
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
/// Pseudo-code for how [method-call expressions] work. | |
/// | |
/// [method-call expressions]: https://doc.rust-lang.org/reference/expressions/method-call-expr.html | |
fn lookup_method(mut T: Type, method_name: &str) -> Method { | |
// The first step is to build a list of candidate receiver types. | |
let mut candidate_receiver_types = vec![T]; | |
// Obtain these by repeatedly dereferencing the receiver expression's | |
// type, adding each type encountered to the list, | |
while let Some(U) = <T as Deref>::Target { |
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
schema { | |
Query: Query | |
Mutation: Mutation | |
} | |
type Query() { | |
viewer: Viewer! | |
entities_named: SearchableEntitiesQuery! | |
} |
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
-- Initialize tables | |
DROP TABLE IF EXISTS table1, table2; | |
CREATE TABLE table1 (col integer PRIMARY KEY); | |
CREATE TABLE table2 ( | |
col integer REFERENCES table1(col) | |
ON DELETE SET DEFAULT -- Experiment with different ON DELETE clauses | |
); | |
-- Optionally create an index | |
CREATE INDEX ON table2(col); |
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
# Credit to: | |
# - http://derrickgilland.com/posts/automatic-json-serialization-in-flask-views/ | |
# - https://blog.miguelgrinberg.com/post/customizing-the-flask-response-class | |
from flask import Response, Flask, jsonify | |
class AutoJSON(Response): | |
@classmethod | |
def force_type(cls, response, environ=None): | |
"""Override to convert list & dict returns to json.""" |
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 json | |
import h11 | |
from urllib.parse import urlencode | |
class Get: | |
"""Sans-IO implementation of `/get`""" | |
def __init__(self, params): | |
self.params = params |
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
# This file is adapted from h11's example client | |
# See https://github.com/python-hyper/h11/blob/master/examples/basic-client.py | |
import socket | |
import ssl | |
import h11 | |
class Client: | |
def __init__(self, host): | |
self.conn = h11.Connection(our_role=h11.CLIENT) |
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
from pytest import fixture | |
from graphene.test import Client | |
@fixture(scope="session") | |
def _schema(): | |
raise NotImplementedError( | |
"You must implement this fixture yourself." | |
"It should return an instance of `graphene.Schema`" | |
) |
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 enum | |
from eve import Eve | |
from sqlalchemy import Column, Integer, Enum | |
from sqlalchemy.ext.declarative import declarative_base | |
from eve_sqlalchemy import SQL | |
from eve_sqlalchemy.config import DomainConfig, ResourceConfig | |
from eve_sqlalchemy.validation import ValidatorSQL |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# When you type 'up' the first time, it's always updated | |
config.vm.provision 'update', type: 'shell', inline: "apt-get update;apt-get -yq upgrade" | |
# When you provision the machine, you're asked whether you want to update it | |
if ARGV.include?('up') or ARGV.include?('reload') or ARGV.include?('resume') and ARGV.include?('--provision') or ARGV.include?('provision') |