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 / ffmpeg-ubuntu
Created August 11, 2017 08:27
ffmpeg Ubuntu
ffplay -f video4linux2 -video_size 640x480 -i /dev/video0 -vf "fade=in:0:20=out:400:40:alpha=1"
ffplay -f video4linux2 -video_size 640x480 -i /dev/video0 -vf "[0:v]eq=contrast=1:brightness=0:saturation=1:gamma=1"
========================= Working
ffplay -f video4linux2 -video_size 640x480 -i /dev/video0 -vf "eq=contrast=1.5:brightness=-0.05:saturation=0.75"
==============================
@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