-
Head over to firebase. Sign in and create a project.
-
Copy your project settings under Firebase SDK snippet into your local project (ie your project's
api key,auth domain,databaseURL, etc) -
Create a file (firebase.js or config.js Any name that suits you is fine)
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
| /* eslint-disable @typescript-eslint/no-explicit-any */ | |
| import { User } from "better-auth"; | |
| import { z } from "zod"; | |
| import { auth } from "./auth"; | |
| import { headers } from "next/headers"; | |
| /** | |
| * Represents the state of an action, including optional error and success messages. | |
| */ | |
| export type ActionState = { |
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
| /** | |
| * Sets up a DOM MutationObserver that watches for elements using undefined CSS | |
| * class names. Performance should be pretty good, but it's probably best to | |
| * avoid using this in production. | |
| * | |
| * Usage: | |
| * | |
| * import cssCheck from './checkForUndefinedCSSClasses.js' | |
| * | |
| * // Call before DOM renders (e.g. in <HEAD> or prior to React.render()) |
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
| // Copy and paste the one you need | |
| // Check current registration | |
| navigator.serviceWorker.getRegistration() | |
| .then(registration => console.log('Registration : ', registration)); | |
| // Cancel current registation | |
| navigator.serviceWorker.getRegistration() | |
| .then(async (registration)=>{ | |
| if (!registration){ |
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
| const FullHeightPage = () => ( | |
| <div> | |
| Hello World! | |
| <style global jsx>{` | |
| html, | |
| body, | |
| body > div:first-child, | |
| div#__next, | |
| div#__next > div { | |
| height: 100%; |
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 ruby | |
| require 'open-uri' | |
| require 'json' | |
| language = 'en' | |
| article = ARGV[0] || | |
| begin | |
| print 'What do you need to know? : ' | |
| URI::encode gets.chomp |
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'); | |
| var lame = require('lame'); | |
| var Speaker = require('speaker'); | |
| fs.createReadStream(process.argv[2]) | |
| .pipe(new lame.Decoder()) | |
| .on('format', function (format) { | |
| this.pipe(new Speaker(format)); | |
| }); |
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
| from xml.dom import minidom | |
| import json | |
| config = { | |
| 'svg_file' : 'map.svg', | |
| 'js_file' : 'map.js', | |
| 'js_var' : 'svgMap' | |
| } | |
| svg = minidom.parse(config['svg_file']) |