Skip to content

Instantly share code, notes, and snippets.

View buraksakalli's full-sized avatar
⌨️
Typing...

Burak Sakalli buraksakalli

⌨️
Typing...
View GitHub Profile
@buraksakalli
buraksakalli / ld-json.tsx
Created June 7, 2022 06:47
LD JSON Next.js
<Head>
<script type="application/ld+json">
{`{
"@context":"https://schema.org","@type":"FAQPage",
"mainEntity": [
${faq?.map((f: { label: string; description: string }) => {
return `{
"@type": "Question",
"name": "${f.label}",
"acceptedAnswer": {
@buraksakalli
buraksakalli / package.json
Created April 21, 2022 12:24
Next.js On Demand ISR Custom Server Error Fix
// Error
// Error: "hostname" and "port" must be provided when starting next to use "unstable_revalidate". See more here https://nextjs.org/docs/advanced-features/custom-server
// You need to pass hostname and port in your start command.
{
"start": "next start --hostname=0.0.0.0 --port=3000"
}
@buraksakalli
buraksakalli / onesignal.js
Created July 13, 2021 08:14
React-Native get OneSignal player_id
import OneSignal from 'react-native-onesignal';
const getPlayerID = async () => {
const {userId} = await OneSignal.getDeviceState();
};
@buraksakalli
buraksakalli / import.js
Created March 10, 2021 09:50
Next.js Dynamic Import a Library or Component
import dynamic from 'next/dynamic';
const Component = dynamic(() => import('lib-name or component dir'), { ssr: false });
// Example for a lib
const Chart = dynamic(() => import('react-apexcharts'), { ssr: false })
// Example for a component
const Button = dynamic(() => import('../components/Button'), { ssr: false })
@buraksakalli
buraksakalli / key.md
Created August 20, 2020 11:39
Get Android App Certificate Fingerprints
keytool -list -v -keystore {LOCATION ./app.keystore} -alias {ALIAS NAME} -storepass {STORE PASS} -keypass {KEY PASS}

Output:

fingerprints

@buraksakalli
buraksakalli / cloudflare.sh
Created May 12, 2020 21:17
Cloudflare Get Domain's DNS Record
# This returns your domain's details which is in query as a parameter. In `result` property `id` is your DNS Record ID
curl -X GET "https://api.cloudflare.com/client/v4/zones/ZONE_ID/dns_records?type=A&name=<Domain>" \
-H "X-Auth-Email: <email>" \
-H "X-Auth-Key: <Global API Key>" \
-H "Content-Type: application/json"
@buraksakalli
buraksakalli / mongodb-create-user
Last active March 4, 2020 08:04
MongoDB create user that has admin role
use admin
db.createUser(
{
user: "<username>",
pwd: "<password>",
roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"]
}
)
@buraksakalli
buraksakalli / mongod.conf
Last active March 4, 2020 07:40
MongoDB Binding Multiple IP
> nano /etc/mongod.conf
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1,<your_inet_ip> #no space between addresses.