Skip to content

Instantly share code, notes, and snippets.

View oussaki's full-sized avatar
🎯
Focusing

Oussama abdallah oussaki

🎯
Focusing
View GitHub Profile
admin.addPeer("enode://da0c61fe14ba9da1a9835b59d811553d21787448724cfe6412bc17f0b14586df91826d8286b2137342d09a8631df5ea548cf301294b05657c2a90f9c3d526721@143.198.119.44:30303");
admin.addPeer("enode://3e2287c6caf363357efc600611ccb777e6997ef8b749b1f87e94d3a7d2b466bbefba163b0620c88804f18bc70cfbe68538720ac2644fc1c970848488cdca0c7a@143.198.114.251:30303");
admin.addPeer("enode://15ea76b5d30ce9eaabf6a9a8fe5ca0ff032534d296b5b8ca6e00a730d08a4aaa019077c382a6b2d08ebc7cf6f8eb888f5e00e0dd378798e3459a555538654370@157.230.6.79:30303");
admin.addPeer("enode://2e718763172902a8fa4bcdda45f77a5c2688de5230e184d154e4867922b8f6ad23e1016379715cb5f55f6c79060563f93896035e35dfb47361d08599d4908ae8@143.198.118.178:30303");
admin.addPeer("enode://9d45f21eeb37bd5555fac0c4094ae3d4d144d93e2313aeb891bf3054b0dcf6ca817961ed29ea1de00389b5c36dc6bbe9b00443e367b16ed8ba251cea6c242044@94.176.237.140:30303");
admin.addPeer("enode://2493b5b8407ccb1c448d7ad358e838066640f273442730caf80acde2fe98522b1d9dcebd2dc982efe44911a49779888fe72defc181c29596facff05e1
@florina-muntenescu
florina-muntenescu / BaseDao.kt
Last active September 28, 2023 15:01
Use Dao inheritance to reduce the amount of boilerplate code - https://medium.com/google-developers/7-pro-tips-for-room-fbadea4bfbd1
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@iammert
iammert / NewIntentProcessor.java
Created May 9, 2017 08:24
NewIntentProcessor
public class NewIntentProcessor extends AbstractProcessor {
private static final String METHOD_PREFIX = "start";
private static final ClassName classIntent = ClassName.get("android.content", "Intent");
private static final ClassName classContext = ClassName.get("android.content", "Context");
private Filer filer;
private Messager messager;
private Elements elements;
private Map<String, String> activitiesWithPackage;
@marciogranzotto
marciogranzotto / VIPER Android Example.kt
Last active April 16, 2021 08:41
This is an example of Android development with VIPER in Kotlin
interface LoginContracts {
interface View {
fun showError(message: String)
}
interface Presenter {
fun onDestroy()
fun onLoginButtonPressed(username: String, password: String)
}
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active June 24, 2023 07:38
firebase notification sample in php . if you like this code follow me and star it . i will follow you and use your codes and share them . Simple PHP FireBase (FCM) script showing how to send an Android push notification. Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',
@andymatuschak
andymatuschak / States-v3.md
Last active April 12, 2024 16:06
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

@prime31
prime31 / gist:5675017
Last active April 2, 2024 03:55
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array