Skip to content

Instantly share code, notes, and snippets.

View sachindayl's full-sized avatar

Sachinda Liyanaarachchi sachindayl

View GitHub Profile
@sachindayl
sachindayl / redis_commands.md
Created August 12, 2022 08:50
[Redis Commands] #redis #backend

Set the password when the pc is restarted if it is not already set on redis.conf

CONFIG SET requirepass 'password'

@sachindayl
sachindayl / cocoapods_commands.md
Created July 27, 2022 08:20
[Cocapods Commands] #ios #flutter

Important: For arm processors need this in the beginning

arch -x86_64

Install pods

pod install

Get rid of podfile

pod deintegrate

Clear cache

@sachindayl
sachindayl / adb_localhost.md
Last active May 27, 2022 13:48
[ADB Open Localhost Port] #android

Open localhost port for android

adb reverse tcp:5300 tcp:5300

@sachindayl
sachindayl / scaffold_contract.dart
Created April 1, 2022 01:57
[Scaffold Contract] #flutter
import 'package:app/shared/models/enums.dart';
import 'package:flutter/widgets.dart';
abstract class BaseViewScaffoldContract {
bool get isSliverNavigation;
String get pageTitle;
List<Widget> get slivers;
@sachindayl
sachindayl / material_view_scaffold.dart
Created April 1, 2022 01:55
[Material View Scaffold] #flutter
import 'package:app/material/widgets/material_circular_progress_indicator_widget.dart';
import 'package:app/shared/base/base_styles.dart';
import 'package:app/shared/base/base_view_scaffold_contract.dart';
import 'package:app/shared/base/constants/constants.dart';
import 'package:app/shared/models/enums.dart';
import 'package:flutter/material.dart';
class ViewScaffold extends StatelessWidget
with PreferredSizeWidget
implements BaseViewScaffoldContract {
@sachindayl
sachindayl / cupertino_view_scaffold.dart
Created April 1, 2022 01:54
[Cupertino View Scaffold] #flutter
import 'package:app/cupertino/widgets/custom_cupertino_circular_progress_indicator.dart';
import 'package:app/shared/base/constants/constants.dart';
import 'package:app/shared/models/enums.dart';
import 'package:flutter/cupertino.dart';
class BaseViewScaffold extends StatelessWidget {
final bool isSliverNavigation;
final Widget? navigationBar;
final String pageTitle;
final List<Widget> slivers;
@sachindayl
sachindayl / graphql.md
Last active April 17, 2022 02:53
[GraphQL Commands] Commands to help with GraphiQL in Python #graphql #python

Mutation exampls

mutation addAddressAsEntry {
  addAddress(address:{
    id:1,
    address1: "Test",
    address2: "Test2",
    city: "City",
    state: "OH",
 zip: "12134",
@sachindayl
sachindayl / flutter_commands.md
Last active March 29, 2022 12:31
[Flutter Commands] Flutter terminal commands related to building #flutter

Reduce shader compilation jank

use SkSL warm up

flutter run --profile --cache-sksl

If the same app has been previously run without --cache-sksl, then

flutter run --profile --cache-sksl --purge-persistent-cache

To build sksl.json file, trigger many animations as possible and then press Shift+m (M)

@sachindayl
sachindayl / pdf_convert.md
Last active January 14, 2022 19:17
PDF convert and reduce size

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook
-dNOPAUSE -dBATCH -dColorImageResolution=150
-sOutputFile=output.pdf file-to-convert.pdf

@sachindayl
sachindayl / sql_commands.md
Last active August 10, 2022 17:32
[Postgres SQL commands] #postgres

Milysto Mercati

INSERT INTO public.shops(
	id, user_id, category_id, name, address, city, province, country, zip, created, updated)
	VALUES (3, 3, 1, 'Test Shop', 'Via Raffaele Conforti 156', 'Cocullo', 'Cuneo', 'Italy', '12062', current_timestamp, current_timestamp);
INSERT INTO public.order_items(