next.js, nginx, reverse-proxy, ssl
$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt| import { useState } from './state' | |
| export const useActions = defineStore('repo.actions', () => { | |
| const state = useState() | |
| function alertFoo(): void { | |
| alert(state.foo) | |
| } | |
| function incrementBar(amount = 1) { | 
| <!-- | |
| '************************************************************************* | |
| ' | |
| ' b-PAC 3.2 Component Sample for Extensions (JS_NamePlate.html) | |
| ' | |
| ' (C)Copyright Brother Industries, Ltd. 2019 | |
| ' | |
| '*************************************************************************/ | |
| --> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 
| <script> | |
| // Obtain UI widgets | |
| const nativePicker = document.querySelector(".nativeDatePicker"); | |
| const fallbackPicker = document.querySelector(".fallbackDatePicker"); | |
| const fallbackLabel = document.querySelector(".fallbackLabel"); | |
| const yearSelect = document.querySelector("#year"); | |
| const monthSelect = document.querySelector("#month"); | |
| const daySelect = document.querySelector("#day"); | 
| <?php | |
| $startOfMonth = Carbon::now()->startOfMonth(); | |
| $endOfMonth = Carbon::now()->endOfMonth(); | |
| $instances = CarbonPeriod::create($startOfMonth, $endOfMonth); | |
| $dates = []; | |
| foreach($instances as $instance) { | |
| $dates[] = $instance->toString(); | 
| import { NextApiHandler, NextApiRequest } from "next"; | |
| import formidable from "formidable"; | |
| import path from "path"; | |
| import fs from "fs/promises"; | |
| export const config = { | |
| api: { | |
| bodyParser: false, | |
| }, | |
| }; | 
| import { useState, useEffect } from "react"; | |
| const useDebounce = (value, delay) => { | |
| const [debouncedValue, setDebouncedValue] = useState(value); | |
| useEffect(() => { | |
| const handler = setTimeout(() => { | |
| setDebouncedValue(value); | |
| }, delay); | 
Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.
NOTE: This logic can be extended to more than two accounts also. :)
The setup can be done in 5 easy steps:
| #include <cstdio> | |
| void callback(int (*function)(int, int), int a, int b) | |
| { | |
| printf("%d\n", function(a, b)); | |
| } | |
| int sum(int a, int b) | |
| { | |
| return a + b; | |
| } | |
| int multiply(int a, int b) | 
| <?php | |
| use Illuminate\Http\Request; | |
| use Illuminate\Support\Facades\Route; | |
| use Illuminate\Support\Facades\Session; | |
| use GuzzleHttp\Client; | |
| class Instagram | |
| { | |
| private string $clientId; |