Skip to content

Instantly share code, notes, and snippets.

View tclain's full-sized avatar

Timothée Clain tclain

View GitHub Profile
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL")
directUrl = env("POSTGRES_URL_NON_POOLING")
}
@tclain
tclain / machine.js
Created April 6, 2021 19:54
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
class CustomUserAdmin(UserAdmin):
inlines = (ProfileInline, ApiTokenInline)
list_display = ('username', 'free_evaluation_count', 'credits_balance', 'paid_evaluation_count',)
def get_readonly_fields(self, request, obj=None):
fields=super(UserAdmin, self).get_readonly_fields(request, obj)
return fields + ('free_evaluation_count', 'paid_evaluation_count', 'credits_balance',)
def get_fieldsets(self, request, obj=None):
@tclain
tclain / cloudSettings
Last active July 5, 2019 20:14
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-07-05T20:14:13.088Z","extensionVersion":"v3.3.1"}
// define a object for you theme
export const theme = {
'colors.hello': true
}
// dynamically infer the possible theme key
export type ThemeKeys = keyof typeof theme
function tagged(strings: TemplateStringsArray, ...args: boolean[]){
// do something
console.log(args)
}
const PrestyledComponent = styled('div')`
/** real css here */
background-color: blue;
`
// usage
const Component = () => <PrestyledComponent />
html`<h1>Hello ${name}</h1>`;
["Hello,", ",World"]
myTemplate`Hello,${"Timothee"},World`