Skip to content

Instantly share code, notes, and snippets.

View mahmed8003's full-sized avatar

Muhammad Ahmed mahmed8003

View GitHub Profile
@slightfoot
slightfoot / main.dart
Last active June 19, 2022 11:15
Firebase Login/Logout Example - by Simon Lightfoot
/*
This example uses the following packages:
firebase_auth: 0.14.0+5
google_sign_in: 4.0.7
provider: 3.1.0+1
Make sure you have setup your project with Firebase by following these instructions:
1. Follow Option 1 instructions here up to Step 3
@slightfoot
slightfoot / multi_select.dart
Last active August 3, 2023 18:10
Multi Select GridView in Flutter - by Simon Lightfoot (Drag to select multiple items) Try now here: https://dartpad.dev/?id=a002dd1e031f5f012f810c6d5da14a11
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / capture_widget.dart
Created August 12, 2019 12:58
Capture Flutter Widgets as Image but Off Screen
import 'dart:async';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(
MaterialApp(
@slightfoot
slightfoot / charts.dart
Created October 10, 2018 20:10
Charts Demo - 10th October 2018 - #HumpdayQandA
import 'dart:math';
import 'package:flutter/material.dart';
void main() => runApp(ChartsDemoApp());
class ChartsDemoApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@igrr
igrr / ESP8266httpsUpdate.ino
Last active October 30, 2022 14:18
ESP8266 ota over HTTPS
/*
OTA update over HTTPS
As an example, we download and install ESP8266Basic firmware from github.
Requires latest git version of the core (November 17, 2015)
Created by Ivan Grokhotkov, 2015.
This example is in public domain.
*/
@ochinchina
ochinchina / EchoClient.java
Last active September 20, 2023 09:52
Async socket demo in java
package asyncsocket;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.channels.CompletionHandler;
import java.util.concurrent.atomic.AtomicInteger;
@alinpopa
alinpopa / gist:1281448
Created October 12, 2011 15:05 — forked from vshkurin/gist:1109136
elasticsearch analyzer example - Test Queries
# Index
---------------------------------------------------------------------
curl -XPUT http://localhost:9200/pictures/ -d '
{
"settings": {
"analysis": {
"analyzer": {
"index_analyzer": {
"tokenizer": "standard",
@yagihiro
yagihiro / CircularBuffer.h
Created February 18, 2009 09:50
circular buffer library for Arduino (C++)
/*
CircularBuffer.h - circular buffer library for Arduino.
Copyright (c) 2009 Hiroki Yagita.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to