Skip to content

Instantly share code, notes, and snippets.

View lightsofapollo's full-sized avatar

James Lal lightsofapollo

View GitHub Profile
{ code:
'4/GwGg5miSAcd1wKy9Ye81SLrk6P5fqo46m_W9Vwh2KFBQgHhK-jA4cVsZn2XG57t7-Bdq4XHJ-uKPQvJdJjnkVIM' }
{ values:
{ code:
'4/GwGg5miSAcd1wKy9Ye81SLrk6P5fqo46m_W9Vwh2KFBQgHhK-jA4cVsZn2XG57t7-Bdq4XHJ-uKPQvJdJjnkVIM',
client_id:
'689324920305-m6h4n6blvhaalrgc89dese8s5tca9kol.apps.googleusercontent.com',
client_secret: '8OC4sIVWQotJuenxrfmFQL2i',
redirect_uri: 'https://conduitventures.consulting/auth/google',
grant_type: 'authorization_code',
scalar DateTime @class(name: "Date")
enum TaskStatus {
Created
InProgress
Done
}
input InputCreateTaskEntity {
ownerEmail: String! @IsEmail
type User {
name: String!
@required
@string(min: 5)
}
enum UserTypes {
SuperUser
Administrator
Customer
}
enum Gender {
"""
Men
"""
[@gql.name "AuthRoles"]
[@gql.comment "Authentication roles for all users"]
[@gql.type]
type authRoles = [ | `SuperUser | `Administrator | `User];
[@gql.type]
module User = {
type t = {
id: string,
email: string,
const handleChange = name => {
return e => {
this.setState({
[name]: e.target.value,
});
};
};
class Foo extends Component {
it('gets a route but is not authed', (done) => {
chai.request(server)
.get('/')
.end((err, res) => {
assert(res.request.url.endsWith('/login'),
'should be redirected to /login');
done();
});
});
type Result<E, V> = [null, V] | [E, null];
const emailList = ['james@silklabs.com'];
function searchForEmail(email: string): Result<Error, bool> {
if (email.indexOf('@') === -1) {
return [new Error('this is not an email'), null];
}
// here we would do an actual search for the email ...
class EventWaiter {
_emitter: EventEmitter;
_event: string;
_promise: Promise<mixed>;
_accept: Function;
_onEvent = (value) => {
this._accept(value);
this._emitter.removeEventListener(this._event, this._onEvent);
type BlobUploadInput = {
stuff: string;
};
class BlobUpload {
stuff: string;
constructor(obj: BlobUploadInput) {
Object.assign(this, obj);
}