Skip to content

Instantly share code, notes, and snippets.

@mathix420
mathix420 / medium.user.js
Last active June 15, 2024 17:22
Bypass Medium Paywall - Working late 2023 - Greasy Fork, Violentmonkey, Tampermonkey - Click the RAW button to install
// ==UserScript==
// @name Medium Paywall Bypass
// @namespace Violentmonkey Scripts
// @run-at document-start
// @match *://*.medium.com/*
// @match *://medium.com/*
// @match *://*/*
// @grant none
// @version 2.4
// @inject-into content
@rtybanana
rtybanana / marquee.dart
Created October 1, 2021 22:08
Marquee wrapper which only scrolls if the text is large enough
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:marquee/marquee.dart' as wrapped;
class Marquee extends StatelessWidget {
final String text;
final TextStyle? style;
final double? textScaleFactor;
final TextDirection textDirection;
final Axis scrollAxis;
@ltOgt
ltOgt / conditional_parent_widget.dart
Created June 29, 2020 14:50
Flutter Widget to conditionally wrap a subtree with a parent without breaking the code tree
import 'package:flutter/widgets.dart';
/// Conditionally wrap a subtree with a parent widget without breaking the code tree.
///
/// [condition]: the condition depending on which the subtree [child] is wrapped with the parent.
/// [child]: The subtree that should always be build.
/// [conditionalBuilder]: builds the parent with the subtree [child].
///
/// ___________
/// Usage:
@f3401pal
f3401pal / app\build.gradle.kts
Last active January 5, 2024 13:53
Multi-module Android project with Kotlin DSL for Gradle
plugins {
`android-base-app`
`android-base`
id("io.fabric")
}
android {
defaultConfig {
versionCode = 20
versionName = "1.6.3"
/// 0 - Example `Streams`
Stream<MyUserModel> userStream => FirebaseAuth
.instance
.onAuthStateChanged
.map((user) => MyUserModel.fromFirebase(user));
String documentPath = 'my/document';
Stream<MyDocumentModel> documentStream = Firestore.instance
.document(documentPath)
.snapshots()
@steven2358
steven2358 / ffmpeg.md
Last active June 12, 2024 01:10
FFmpeg cheat sheet
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active June 15, 2024 08:22
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@tylermilner
tylermilner / copy_appropriate_google-service-info-plist.sh
Last active April 29, 2024 14:50
A shell script to selectively copy your GoogleService-Info.plist into your app bundle based on the current build configuration.
# Name of the resource we're selectively copying
GOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist
# Get references to dev and prod versions of the GoogleService-Info.plist
# NOTE: These should only live on the file system and should NOT be part of the target (since we'll be adding them to the target manually)
GOOGLESERVICE_INFO_DEV=${PROJECT_DIR}/${TARGET_NAME}/Firebase/Dev/${GOOGLESERVICE_INFO_PLIST}
GOOGLESERVICE_INFO_PROD=${PROJECT_DIR}/${TARGET_NAME}/Firebase/Prod/${GOOGLESERVICE_INFO_PLIST}
# Make sure the dev version of GoogleService-Info.plist exists
echo "Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_DEV}"
@siamak
siamak / gradient.js
Last active April 5, 2019 11:09
Steps in Gradient
/**
* GradientArray • Steps gradient.
* @author Siamak Mokhtari <hi@siamak.work>
* @date 06/21/16.
*/
class GradientArray {
// Convert a hex color to an RGB array e.g. [r,g,b]
// Accepts the following formats: FFF, FFFFFF, #FFF, #FFFFFF
hexToRgb(hex) {
let r, g, b, parts;
@gabrielemariotti
gabrielemariotti / README.md
Last active February 24, 2021 10:52
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
 ----dependencies.gradle