Skip to content

Instantly share code, notes, and snippets.

App review - spawn a review only when user meets a threashold

Still Testing

import 'dart:math';

import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:in_app_review/in_app_review.dart';
import 'package:zylag/core/data/local_data_source.dart';
import 'package:zylag/core/data/typedefs.dart';
@ryansechrest
ryansechrest / php-style-guide.md
Last active April 16, 2024 07:38
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@Toliak
Toliak / RESEARCH.md
Last active April 16, 2024 07:37
Huawei Matebook D16 RLEF-X NVMe Laptop Disk is read-only after sleep problem research and fix

I have bought laptop Huawei Matebook D16 RLEF-X. Tried to use Arch Linux and encountered with the problem:

  1. Turn on the suspend mode (sudo systemctl suspend)
  2. Close the laptop lid
  3. Wait a few minutes
  4. Open the laptop back
  5. Use mount to see that the disk is read-only. Moreover, it determines like read-only, however, it is just broken. No zsh history, no executables, no way to poweroff without power button long-press.
@bosley
bosley / PubSub_with_ifs.cpp
Created April 2, 2020 17:14
A simple pubsub example using an interface in C++
#include <iostream>
#include <string>
#include <vector>
namespace {
// An interface for objects that want to 'be' subscribers
class SubscriberIf {
public:
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 16, 2024 07:34
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@daverich204
daverich204 / Code.gs
Last active April 16, 2024 07:34
Yahoo Finance AppsScript for Google Sheets
function yahooF(ticker) {
const url = `https://query1.finance.yahoo.com/v8/finance/chart/${ticker}`;
const res = UrlFetchApp.fetch(url, {muteHttpExceptions: true});
const contentText = res.getContentText();
const data = JSON.parse(contentText);
// Check if the result exists and has data
if (data && data.chart && data.chart.result && data.chart.result.length > 0) {
const regularMarketPrice = data.chart.result[0].meta.regularMarketPrice;
@lvnilesh
lvnilesh / easy-nip5.md
Last active April 16, 2024 07:33
easy-nip5 on cloudflare

STEP 1: Create a worker and map it to a route like below.

*yourdomain.com/.well-known/nostr.json*

STEP 2: Use this sample as your worker.js

addEventListener('fetch', event =&gt; {
upstream redis {
server 127.0.0.1:6379;
keepalive 512;
}
server {
listen 80;
server_name www.mf8.biz mf8.biz;
access_log off;
index index.html index.htm index.php;
@mgechev
mgechev / basic-tcp-server.dart
Created June 17, 2013 15:55
Basic TCP server in Dart
import 'dart:core';
import 'dart:async';
import 'dart:io';
void startServer() {
Future<ServerSocket> serverFuture = ServerSocket.bind('0.0.0.0', 55555);
serverFuture.then((ServerSocket server) {
server.listen((Socket socket) {
socket.listen((List<int> data) {
String result = new String.fromCharCodes(data);
@bradtraversy
bradtraversy / terminal-commands.md
Last active April 16, 2024 07:28
Common Terminal Commands

Common Terminal Commands

Key Commands & Navigation

Before we look at some common commands, I just want to note a few keyboard commands that are very helpful:

  • Up Arrow: Will show your last command
  • Down Arrow: Will show your next command
  • Tab: Will auto-complete your command
  • Ctrl + L: Will clear the screen