Skip to content

Instantly share code, notes, and snippets.

View mohamedebrahim96's full-sized avatar
Official

Mohamed Ebrahim mohamedebrahim96

Official
View GitHub Profile
@kellyvaughn
kellyvaughn / taproom-workflow.md
Created November 11, 2020 20:23
Taproom Workflow

Git & Github Process

Git and Gihub provide several benefits to the team and is an essential tool to The Taproom for collaboration and flexibility. Here are some of the guidelines we aim to follow:

  1. Utilize branches - While working on master, branches allow for more collaboration, conversation, and control around changes being made to the code. Commits directly to master should be limited to settings_data updates, client theme updates, typo fixes and emergency bug fixes.
import 'dart:async';
import 'dart:convert';
import 'dart:ffi';
import 'dart:io';
import 'package:ffi/ffi.dart';
import 'package:win32/win32.dart';
const healthOffset = 0x12FC58;
import 'package:flutter/material.dart';
void main() => runApp(
MaterialApp(
home: BallPage(),
),
);
class BallPage extends StatelessWidget {
@override
@nourharidy
nourharidy / HODLer.sol
Last active December 3, 2018 07:38
Simple HODLer contract. Written in 10mins. Passed static analysis but is not guaranteed to be safe.
pragma solidity ^0.5.0;
contract HODLer {
uint releaseDate;
address owner;
// Contract deployer specifies deposit release date in constructor
constructor(uint secondsSince1971) public {
@Drjacky
Drjacky / dependencies.gradle
Last active July 30, 2020 06:42
Dependencies in a separated file - Useful for Clean Architecture and Modular Android Applications
ext {
// Android
minSdkVersion = 14
targetSdkVersion = 28
versionCode = 1
versionName = "1.0"
androidCompileSdkVersion = 28
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
// Libraries
ankoVersion = '0.10.4'
@mohamedebrahim96
mohamedebrahim96 / linkedin.md
Last active September 16, 2018 03:43
Script to automatically add connections from "People You May Know" page

LinkedIn auto inviter

in this Gist you can invite all connictions just by one click

@chrisbanes
chrisbanes / ScopedViewModel.kt
Last active October 2, 2024 04:13
ScopedViewModel
open class ScopedViewModel : ViewModel() {
private val job = Job()
protected val scope: CoroutineScope = job + Dispatchers.Main
override fun onCleared() {
super.onCleared()
job.cancel()
}
}
@mohamedebrahim96
mohamedebrahim96 / Permissions.md
Last active March 26, 2021 01:23
Requesting Runtime Permissions In Android M And N, Starting from Android Marshmallow (API 23), users will be asked for permissions while the app is running. This way, a user is able to choose which permissions they should grant without affecting the application flow. In this tutorial I will cover requesting runtime permissions in Android M and N…

Starting from Android Marshmallow (API 23), users will be asked for permissions while the app is running. This way, a user is able to choose which permissions they should grant without affecting the application flow. In this tutorial I will cover requesting runtime permissions in Android M and N, how to perform a request, get its result and then handle it.

@mohamedebrahim96
mohamedebrahim96 / activity_main2.xml
Last active December 12, 2018 23:10
The function of the button at the center is to call an activity and the TabLayout will be place at the bottom of the screen.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.vacuum.app.cinema.MainActivity">
<!--SOME CODE FOR MY AppBarLayout-->
<!--SOME CODE FOR MY ToolBar-->
@LouisCAD
LouisCAD / GooglePlayServices.kt
Created November 23, 2017 16:19
Allows using Google Play Services Task API in Kotlin Coroutines, plus Play Services availability check made easier.
import com.google.android.gms.common.GoogleApiAvailability
import com.google.android.gms.tasks.Task
import splitties.init.appCtx
import kotlin.coroutines.experimental.suspendCoroutine
val googleApiAvailability = GoogleApiAvailability.getInstance()!!
inline val playServicesAvailability get() = googleApiAvailability.isGooglePlayServicesAvailable(appCtx)
@JvmName("awaitVoid")
suspend fun Task<Void>.await() = suspendCoroutine<Unit> { continuation ->