Skip to content

Instantly share code, notes, and snippets.

View krisztianodor's full-sized avatar

krisztianodor

  • Budapest, Hungary
View GitHub Profile
@jbxbergdev
jbxbergdev / marker_icon_generator.dart
Last active December 7, 2023 11:09
Creates a BitmapDescriptor from an IconData object to be used for google_maps_flutter map markers. Read the Medium article here: https://medium.com/@JBXBergDev/how-to-use-googlemap-markers-with-flutter-material-icons-38c4c975e928
import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class MarkerGenerator {
final _markerSize;
double _circleStrokeWidth;
double _circleOffset;
@letsar
letsar / tab_bar_view.dart
Created June 30, 2018 12:31
How to use a SliverStickyHeader inside a TabBarView
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_sticky_header/flutter_sticky_header.dart';
class _Page {
const _Page(
this.id,
this.title,
this.color,
@abinavseelan
abinavseelan / cloudfunction.js
Last active May 18, 2020 00:17
Firebase Cloud Function to handle online/offline status
const functions = require('firebase-functions');
const Firestore = require('@google-cloud/firestore');
const firestore = new Firestore();
exports.onUserStatusChanged = functions.database
.ref('/status/{userId}') // Reference to the Firebase RealTime database key
.onUpdate(event => {
const usersRef = firestore.collection('/users'); // Create a reference to the Firestore Collection
@hivefans
hivefans / shell_output.go
Last active September 15, 2023 05:59
get the realtime output for a shell command in golang|-|{"files":{"shell_output.go":{"env":"plain"}},"tag":"bigdata"}
package main
import (
"bufio"
"fmt"
"io"
"os"
"os/exec"
"strings"
)
@m4tthumphrey
m4tthumphrey / CronSchedule.php
Last active May 23, 2022 11:29
CronSchedule.php - Allows one to parse a cron expression into human readable text.
<?php
/*
* Plugin: StreamlineFoundation
*
* Class: Schedule
*
* Description: Provides scheduling mechanics including creating a schedule, testing if a specific moment is part of the schedule, moving back
* and forth between scheduled moments in time and translating the created schedule back to a human readable form.
*
* Usage: ::fromCronString() creates a new Schedule class and requires a string in the cron ('* * * * *', $language) format.