This file contains 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 { createClient } from "@midday/supabase/client"; | |
import { getUserQuery } from "@midday/supabase/queries"; | |
import { HeadlessService } from "@novu/headless"; | |
import { useCallback, useEffect, useRef, useState } from "react"; | |
export function useNotifications() { | |
const supabase = createClient(); | |
const [notifications, setNotifications] = useState([]); | |
const [subscriberId, setSubscriberId] = useState(); | |
const headlessServiceRef = useRef<HeadlessService>(); |
This file contains 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 { getSupabaseBrowserClient } from "@midday/supabase/browser-client"; | |
import { getUserDetails } from "@midday/supabase/queries"; | |
import { upload } from "@midday/supabase/storage"; | |
import { useState } from "react"; | |
export function useUpload() { | |
const supabase = getSupabaseBrowserClient(); | |
const [isLoading, setLoading] = useState(false); | |
const uploadFile = async ({ bucketName, file, path }) => { |
This file contains 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 { SupabaseClient } from "@supabase/auth-helpers-nextjs"; | |
type UploadParams = { | |
file: File; | |
path: string; | |
}; | |
export async function upload( | |
client: SupabaseClient, | |
{ file, path }: UploadParams, |
This file contains 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
"use client"; | |
import { useUpload } from "@/hooks/useUpload"; | |
import { getSupabaseBrowserClient } from "@midday/supabase/browser-client"; | |
import { useDropzone } from "react-dropzone"; | |
export function Attachments({ id }) { | |
const supabase = getSupabaseBrowserClient(); | |
const [files, setFiles] = useState<Attachment[]>([]); | |
const { isLoading, uploadFile } = useUpload(); |
This file contains 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
// NOTE: Required for reuse of connection | |
import './utils/typeorm-monkeypatch' | |
import * as express from 'express' | |
import { ApolloServer } from 'apollo-server-express' | |
import { getConnectionManager, Connection } from 'typeorm' | |
import { PostgresDriver } from 'typeorm/driver/postgres/PostgresDriver' | |
import * as depthLimit from 'graphql-depth-limit' | |
import formatError from './utils/formatError' | |
import schema from './schema' | |
import { options} from './models' |
This file contains 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
// Client | |
import { setContext } from 'apollo-link-context' | |
export default setContext(async (_, { headers }) => ({ | |
headers: { | |
...headers, | |
authorization: `Bearer ${localStorage.getItem('token')}`, | |
}, | |
})) |
This file contains 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
#!/bin/sh | |
NGINX_VERSION=1.5.9 | |
TMP_PATH=/tmp | |
# Fetch and extract nginx source | |
cd $TMP_PATH | |
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz | |
tar xvfz nginx-$NGINX_VERSION.tar.gz | |
cd nginx-$NGINX_VERSION |
This file contains 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
About 3 month ago, I discovered Vine (yeah late i know), but i really like the small video clips that made my day. But im a developer and most of the time im sitting in front of the computer so i begun to find a way to watch vines on the computer, but at that moment there where only some simple sites where you couldn't login and get your feed. | |
So i was thinking that maby i can do this by my own, and as a developer i took my iPhone and find all the endpoints for the API. Then a started to design, and this was my first real project that i designed. So i ended upp on dribbble and find inspiration and stated my jurny to build Bottlr. | |
And the result is bellow, the project is done but as you all know the fun part has just begun. I will rebuild and do it better on every free minute. There are many features that will be built in the near feature. | |
Hope you like it! And if you do please check the real thing out here https://bottlr.co | |
Description of technology: | |
Laravel Framework |
This file contains 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
<?php | |
// Get latest posts on single post | |
// Exclude current post | |
function GetLatestPosts( $number = 5 ) | |
{ | |
global $post; | |
$args = array( | |
'posts_per_page' => $number, |
This file contains 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
$('.control a').click( function() | |
{ | |
var currentZoom = map.getZoom(); | |
if( $(this).text() == '+') | |
{ | |
if( currentZoom < 4 ) | |
{ | |
var currentZoom = parseFloat( currentZoom ) + 1; | |
} |