http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
# nil? can be used on any Ruby object. It returns true only if the object is nil. | |
nil.nil? # => true | |
[].nil? # => false | |
{}.nil? # => false | |
"".nil? # => false | |
" ".nil? # => false | |
true.nil? # => false | |
# empty? can be used on some Ruby objects including Arrays, Hashes and Strings. It returns true only if the object's length is zero. | |
nil.empty? # NoMethodError: undefined method `empty?' for nil:NilClass |
//... | |
// some interfaces imports skipped | |
//... | |
const createDirectUploadMutation = ` | |
mutation createDirectUploadMutation( | |
$filename: String! | |
$byteSize: Int! | |
$contentType: String! | |
) { |
function generateColor() { | |
return ( | |
"#" + | |
Math.random() | |
.toString(16) | |
.substr(-6) | |
) | |
} |
CraigMaslowski.erb | |
dbaeumer.vscode-eslint | |
esbenp.prettier-vscode | |
ms-vscode-remote.remote-ssh | |
ms-vscode-remote.remote-ssh-edit | |
ms-vscode-remote.remote-wsl | |
rebornix.ruby | |
vscode-icons-team.vscode-icons | |
wingrunr21.vscode-ruby | |
CraigMaslowski.erb |
{ | |
"cSpell.words": [ | |
"dateutil", "refetch" | |
], | |
"editor.formatOnPaste": true, | |
// "editor.formatOnSave": true, | |
"editor.formatOnType": true, | |
"editor.fontFamily": "'Fira Code iScript', 'Fira Code', Consolas, 'Courier New', monospace", | |
"editor.fontLigatures": true, | |
"editor.tokenColorCustomizations": { |
# frozen_string_literal: true | |
module Mutations | |
module Message | |
# Updating message for the user | |
class MessageUpdate < BaseMutation | |
argument :id, ID, required: true | |
field :message, Types::MessageType, null: true |
http://guides.rubyonrails.org/migrations.html
Picking the right architecture = Picking the right battles + Managing trade-offs
const { ApolloServer, gql } = require("apollo-server"); | |
const jwt = require("jsonwebtoken"); | |
const mongoose = require("mongoose"); | |
const bcrypt = require("bcrypt"); | |
const pick = require("lodash").pick; | |
// configure the user collection | |
const userSchema = mongoose.Schema({ | |
email: String, | |
password: String |
const SECRET="createaverystrongsecretthatalsoincludes2423412wdsa324e34e" | |
const server = new ApolloServer({ | |
schema, | |
context: ({ req }) => { | |
const { user } = req | |
// the user and secret we are passing here is what we access in every resolver | |
return { | |
user, | |
SECRET, |