Skip to content

Instantly share code, notes, and snippets.

@amed
amed / nexus_prisma_cheatsheet.md
Created October 26, 2023 19:29 — forked from amit08255/nexus_prisma_cheatsheet.md
Nexus + Prisma CheatSheet

Nexus + Prisma CheatSheet

Creating model in Prisma

First create generator and datasource entry in your .prisma file like below:

generator client {
  provider = "prisma-client-js"
}
@amed
amed / rspec_rails_cheetsheet.rb
Created March 18, 2017 06:58 — forked from mlr/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet with expect syntax (including capybara matchers)
# Model
expect(@user).to have(1).error_on(:username) # checks whether there is an error in username
expect(@user.errors[:username]).to include("can't be blank") # check for the error message
# Rendering
expect(response).to render_template(:index)
# Redirecting
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
context "GET index" do
#context "POST create" do
#context "GET show" do
#context "PATCH update" do (or PUT update)
#context "DELETE destroy" do
#context "GET new" do
@amed
amed / 0-media-query-snippets.md
Created March 14, 2017 21:37 — forked from rstacruz/0-media-query-snippets.md
Media query snippets

Media query snippets

Type b4+ then press TAB. It expands to

@media (min-width: $screen-xs-min) { // > 480px

Snippets