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
| #!/usr/bin/env python3 | |
| import sys | |
| def format_migration_as_text_array(filename): | |
| """Format a migration file as PostgreSQL text[] array literal""" | |
| try: | |
| with open(filename, 'r') as f: | |
| lines = f.read().splitlines() | |
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 { SupabaseBucket, SUPBABASE_BUCKETS } from "@helpers/fileHelpers" | |
| import { createRouteHandlerClient } from "@supabase/auth-helpers-nextjs" | |
| import { createClient } from "@supabase/supabase-js" | |
| import { cookies } from "next/headers" | |
| import { NextRequest, NextResponse } from "next/server" | |
| import { Database } from "../../../../types/supabase" | |
| /** | |
| * DELETE to: | |
| * http://localhost:3000/api/actions/delete-account |
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
| {% set prevSibling = craft.entries().prevSiblingOf(entry).one() %} | |
| {% set nextSibling = craft.entries().nextSiblingOf(entry).one() %} | |
| {% set prevEntry = prevSibling ? prevSibling : craft.entries().section('work').inReverse().one() %} | |
| {% set nextEntry = nextSibling ? nextSibling : craft.entries().section('work').one() %} |
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
| // API Call | |
| // https://preview.contentful.com/spaces/spoqsaf9291f/environments/master/entries?sys.id=5R8jRmZhFypDxCs0oVjV3D&include=4 | |
| // Response | |
| { | |
| "sys": { | |
| "type": "Array" | |
| }, | |
| "total": 1, | |
| "skip": 0, |
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
| // API call | |
| // https://cdn.contentful.com/spaces/spoqsaf9291f/environments/master/entries?sys.id=5R8jRmZhFypDxCs0oVjV3D&include=4 | |
| // Response | |
| { | |
| "sys": { | |
| "type": "Array" | |
| }, | |
| "total": 1, | |
| "skip": 0, |
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
| { | |
| "sys": { | |
| "type": "Array" | |
| }, | |
| "total": 1, | |
| "skip": 0, | |
| "limit": 100, | |
| "items": [ | |
| { | |
| "sys": { |
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
| <template> | |
| <p>Hello, {%= @user.name %}!</p> | |
| <div id="replace-me"></div> | |
| </template> | |
| <script> | |
| document.getElementById("replace-me").innerHTML = "Welcome to the future."; | |
| </script> | |
| <style scoped> |
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
| <template> | |
| <p>{{ greeting }} World!</p> | |
| </template> | |
| <script> | |
| module.exports = { | |
| data: function () { | |
| return { | |
| greeting: 'Hello' | |
| } |
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
| @profiles = Profile | |
| .where(visible: true) | |
| .includes(:profile_type) | |
| .joins(:user) | |
| .where(:users => {:state => User.states[:active]}) | |
| sort_by = params[:sort] ? params[:sort] : "recently-active" | |
| case sort_by | |
| when "recently-active" | |
| @profiles = @profiles.order('users.last_sign_in_at DESC') |
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
| dropdb db-name | |
| createdb db-name | |
| pg_restore --verbose --clean --no-acl --no-owner -h localhost -d db-name ~/desktop/db-backup |
NewerOlder