Skip to content

Instantly share code, notes, and snippets.

View santoshgistto's full-sized avatar

santosh santoshgistto

View GitHub Profile
@mikecebul
mikecebul / migration.ts
Created September 25, 2024 18:29
How to migrate a collection table to use a different foreign key
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-sqlite'
export async function up({ payload, req }: MigrateUpArgs): Promise<void> {
await payload.db.drizzle.run(sql`
CREATE TABLE IF NOT EXISTS \"team_temp\" (
\"id\" integer PRIMARY KEY NOT NULL,
\"memberType\" text DEFAULT \'staff\',
\"name\" text,
\"avatar_id\" integer,
\"image_id\" integer,
@lukepighetti
lukepighetti / README.md
Last active March 2, 2025 19:33
pocketbase systemd
vim /lib/systemd/system/pocketbase.service
systemctl enable pocketbase
systemctl start pocketbase
systemctl status pocketbase
systemctl stop pocketbase
systemctl restart pocketbase

Enhancing SEO in Flutter Web Projects with Next.js Integration

When building websites with Flutter, a significant challenge encountered is Search Engine Optimization (SEO). The main issue arises because search engine crawlers often fail to index the text content in Flutter web applications. This limitation stems from the fact that Flutter web builds essentially result in static websites, which aren't crawler-friendly by default.

Addressing this challenge with Flutter alone is a daunting task. Given the nature of static sites produced by Flutter web builds, incorporating an additional web project, like one built with Next.js, becomes essential. This approach is not only about solving crawling issues but also about dynamically providing appropriate meta tags based on the content, which is nearly impossible with just Flutter.

Rather than struggling with these limitations, a practical solution involves embedding your Flutter web site within a server-side rendering project like Next.js. This method allows fo

@eslamfaisal
eslamfaisal / BaseStation.java
Created July 8, 2020 21:04
An example to get cell towers info on Android
package com.mirrordust.gpscellinfodemo;
public class BaseStation {
private int mcc; // Mobile Country Code
private int mnc; // Mobile Network Code
private int lac; // Location Area Code or TAC(Tracking Area Code) for LTE
import 'dart:math';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Text Overflow Demo',
@nhtua
nhtua / 00.install-android-sdk.sh
Last active April 14, 2025 05:42
Run a Headless Android Device on Ubuntu server (no GUI)
#!/bin/bash -i
#using shebang with -i to enable interactive mode (auto load .bashrc)
set -e #stop immediately if any error happens
# Install Open SDK
apt update
apt install openjdk-8-jdk -y
update-java-alternatives --set java-1.8.0-openjdk-amd64
java -version
@yoavniran
yoavniran / PreviewLayout.js
Created July 25, 2019 08:55
PreviewLayout for Gatsby & Netlify CMS to enable styled-components
import React, { useRef, useLayoutEffect } from "react";
import { StyleSheetManager } from "styled-components";
import PreviewContext from "./PreviewContext";
const WithPreviewContext = ({ children }) =>
<PreviewContext.Provider value={true}>
<main>
{children}
</main>
</PreviewContext.Provider>;
@sreelallalu
sreelallalu / AndroidManifest.xml
Last active December 8, 2023 22:42
Android USB detection
<uses-feature android:name="android.hardware.usb.host" />
<uses-permission android:name="android.permission.USB_PERMISSION" />
<activity android:name=".activities.MainActivity"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
@AdamJonsson
AdamJonsson / main.dart
Created April 30, 2019 06:32
An example how different widget can be used to expand and collapse content in Flutter
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Expanding Demo',
theme: ThemeData(
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active March 22, 2025 07:22
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.