This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/widgets.dart'; | |
typedef Selector<T, V> = V Function(T value); | |
typedef WidgetReBuilder<T> = Widget Function( | |
BuildContext context, T value, Widget? child); | |
class ReBuilder<T> extends StatefulWidget { | |
final WidgetReBuilder<T> builder; | |
final List<Selector<T, dynamic>> selectors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
class Debouncer { | |
final Duration delay; | |
Timer? _timer; | |
Debouncer({required this.delay}); | |
Future<T> run<T>(Future<T> Function() action) async { | |
if (_timer != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _ServiceLocator { | |
final Map<Type, dynamic> _singletons = <Type, dynamic>{}; | |
final Map<Type, Function> _factories = <Type, Function>{}; | |
// Private constructor | |
_ServiceLocator._(); | |
// Public accessor | |
static final _ServiceLocator instance = _ServiceLocator._(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InteractiveViewerWithRotation extends StatefulWidget { | |
final Widget child; | |
const InteractiveViewerWithRotation({super.key, required this.child}); | |
@override | |
State<InteractiveViewerWithRotation> createState() => | |
_InteractiveViewerWithRotationState(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'node-fetch'; | |
import cheerio from 'cheerio'; | |
import { Configuration, OpenAIApi } from 'openai'; | |
const OPENAI_API_KEY = '<YOUR_OPENAI_API_KEY>'; | |
const DISCOURSE_SERVER_URL = '<YOUR_DISCOURSE_SERVER_URL>'; | |
const DISCOURSE_API_KEY = '<YOUR_DISCOURSE_API_KEY>'; | |
const DISCOURSE_POST_CREATORS = ['<CREATOR1>', '<CREATOR2>']; | |
const DISCOURSE_PRODUCT_MODERATORS = ['<MODERATOR1>', '<MODERATOR2>']; | |
const CATEGORY_ID = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.richard1993.android.inputhack; | |
import android.app.Service; | |
import android.content.Intent; | |
import android.net.nsd.NsdManager; | |
import android.net.nsd.NsdServiceInfo; | |
import android.os.IBinder; | |
import android.util.Log; | |
import java.io.BufferedInputStream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tls = require('tls'); | |
const https = require('https'); | |
const crypto = require('crypto'); | |
const axios = require('axios'); | |
function sha256(s) { | |
return crypto.createHash('sha256').update(s).digest('base64'); | |
} | |
const options = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GHA workflow_dispatch | |
// @namespace https://gist.github.com/rehangit/58409fc3cca4ec7630487ac13a055b27 | |
// @version 0.1.7 | |
// @description Add missing info in workflow_dispatch actions | |
// @author Rehan Ahmad | |
// @match https://github.com/*/*/actions | |
// @match https://github.com/*/*/actions/* | |
// @grant none | |
// @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzIwIiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDdmZmYiPjxjaXJjbGUgY3g9Ijk5LjUiIGN5PSI5OS41IiBzdHJva2Utd2lkdGg9IjE1IiByPSI1MCIvPjxwYXRoIGQ9Ik04NyAxMjJsMzUtMjIuNUw4NyA3N3oiIHN0cm9rZS13aWR0aD0iOCIvPjxwYXRoIGQ9Ik05OS41IDE1MmMwIDIyLjUgMCAyMi41IDk1IDIyLjAxbS05NS0xOS41MWMwIDkyLjcgMCA5Mi43IDY1IDk1IiBzdHJva2Utd2lkdGg9IjE1Ii8+PGNpcmNsZSBjeD0iMjE5LjUiIGN5PSIyNDkuNSIgc3Ryb2tlLXdpZHRoPSIxMCIgcj0iMjUiLz48cGF0aCBkPSJNMjA3IDI0OS41aDdtMTEgMGg3IiBzdHJva2Utd2lkdGg9IjgiIHN0cm9rZS1kYXNoYXJyYXk9IjQwIDQ4Ii8+PGNpcmNsZSBjeD0iMjE5LjUiIGN5PSIxNzQuNSIgc3Ryb2t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.criativasoft.eduaccess.util; | |
import android.util.Log; | |
import java.io.BufferedReader; | |
import java.io.ByteArrayOutputStream; | |
import java.io.Closeable; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; |