This codemod can be used to migrate rejectOnNotFound usages to the new Prisma 4 findUniqueOrThrow
and findFirstOrThrow
methods.
This file contains hidden or 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
/** | |
* Waits for a subscription after a trigger function is called. The trigger function is delayed to | |
* properly time the subscription return event. | |
*/ | |
const waitForSubscription = async <TResult = any>( | |
subscription: DocumentNode, | |
trigger: () => Promise<void> | |
): Promise<ExecutionResult<TResult>> => { | |
const iterator = await subscribe<TResult>( | |
schema, |
This file contains hidden or 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
version: '2' | |
services: | |
directus: | |
image: directus/directus:v8.2.0-apache | |
environment: | |
# App | |
DIRECTUS_APP_ENV: "production" | |
DIRECTUS_APP_TIMEZONE: "America/Los_Angeles" |
I hereby claim:
- I am casey-chow on github.
- I am caseychow (https://keybase.io/caseychow) on keybase.
- I have a public key ASAcYHgmOYDnJ0HpIBBysyRaQ90SLHhPbobCAv-IlNogcwo
To claim this, I am signing this object:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
[cc22@davisson]~% curl 'localhost:33333/1879' | |
JDS 400/REL 400 HA C01 MW 11:00-12:20 Israel's Enslavement and Exodus from Egypt: Exodus 1-15 Baruch J. Schwartz Class of 1879 Hall 133 | |
REL 326 HA C01 MW 1:30-2:50 Buddhist Literature: Interpreting the Lotus Sutra Jacqueline I. Stone Class of 1879 Hall 133 | |
REL 337/NES 357 HA S01 W 1:30-4:20 Slavery and Gender in Islamic Societies Shaun E. Marmon Class of 1879 Hall 231 | |
REL 393 HA S01 M 1:30-4:20 Science and Religion in America Brendan Pietsch Class of 1879 Hall 137 | |
REL 524 S01 Th 3:00-4:20 Religion in the Americas Workshop Jessica Delgado Class of 1879 Hall 137 | |
REL 533 S01 Th 1:30-4:20 Readings in Japanese Religions - Practices, Discourses, Representations Jacqueline I. Stone Class of 1879 Hall 249 |
This file contains hidden or 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
var fs = require('fs'); | |
http.createServer(function (req, res) { | |
fs.readFile('/path/to/json', function (err, data) { | |
var html = '<table>'; | |
for (var elem in data) { | |
if (data.hasOwnProperty(elem)) { | |
html += '<tr><td>' + elem + '</td><td>' + data[elem] + '</td></tr>'; | |
} | |
} | |
html += '</table>'; |
This file contains hidden or 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 java.util.Scanner; | |
class ArrayStuff { | |
public static void main(String args[]) { | |
} | |
public static void tenIntegerVariables() { | |
int[] ints = new int[]{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; |
This file contains hidden or 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
long deadline = date.getTime() + 3000; | |
System.out.println(deadline); | |
System.out.println(Long.toString(date.getTime())); | |
while (date.getTime() < deadline) { | |
boolean enter = input.hasNextByte(); | |
if (enter == true) { | |
misc.fast = true; | |
} | |
try { | |
Thread.sleep(5); |
This file contains hidden or 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
print "Enter numbers, separated by commas: " | |
numbers = gets.chomp.split(/,/) | |
#total = 0 | |
numbers.each do |number| | |
number = number.to_f | |
total = total + number | |
end | |
average = total / numbers.length | |
puts "Average of numbers: #{average.round(2)}" |