Skip to content

Instantly share code, notes, and snippets.

View biniama's full-sized avatar

Biniam biniama

View GitHub Profile
@biniama
biniama / App.jsx
Last active December 3, 2023 18:59
ReactJS Context API
import React, { useState, useEffect, useContext } from 'react'
import './App.css'
import axios from 'axios';
import { CartContext } from './CartContext';
import Cart from './Cart';
import CartNoContext from './CartNoContext';
const App = () => {
const [count, setCount] = useState(0)
@biniama
biniama / index.html
Created March 6, 2023 22:41
Kidan portfolio
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="main.css" />
<title>Kidan's Portfolio</title>
</head>
<body>
@biniama
biniama / flutter_riverpod_async_notifier.dart
Last active December 8, 2022 13:12
AsyncNotifier and AsyncNotifierProvider Example for Flutter
//Add the following in `pubspec.yaml`
dependencies:
flutter_riverpod: ^2.1.1
//If you want to run the example, you also need to install `shared_preferences: ^2.0.13`
//More documentation can be found at //https://codewithandrea.com/articles/flutter-riverpod-async-notifier/
import 'dart:async';
import 'package:flutter/material.dart';
@biniama
biniama / flutter_riverpod_state_notifier.dart
Last active December 8, 2022 12:50
StateNotifier and StateNotifierProvider Example for Flutter
//Add the following in `pubspec.yaml`
dependencies:
flutter_riverpod: ^2.1.1
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
void main() => runApp(ProviderScope(child: MyApp()));
import React, { Component } from "react";
import { Route, Switch } from "react-router-dom";
import PrivateRoute from "../common/PrivateRoute";
class App extends Component {
constructor(props) {
super(props);
this.state = {
authenticated: false,
currentUser: null,
loading: false
@biniama
biniama / new_task.py
Created September 13, 2022 16:04 — forked from quiver/new_task.py
rabbitmq : dead letter exchange example with python/pika
#!/usr/bin/env python
# http://www.rabbitmq.com/tutorials/tutorial-two-python.html
import pika
import sys
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
message = ' '.join(sys.argv[1:]) or "Hello World!"

Making Kubernetes How We Build Things

This talk is all live demos of tools developers can use in their inner-loop, at development time to be more productive with containers.

Start Easier

Docker Compose captures the build arguments and run arguments so we can focus on our coding.

@biniama
biniama / pom.xml
Created March 19, 2021 06:42
Dependencies
<dependencies>
<!-- The app must be a webapp to have an embedded container (e.g. Tomcat) on the classpath. -->
<!-- Otherwise, the app starts and shuts down automatically. -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
@biniama
biniama / balanced_sum.py
Created February 24, 2021 11:59
Hacker Rank Exercises
#!/bin/python3
import math
import os
import random
import re
import sys
#
@biniama
biniama / braking.md
Created June 24, 2020 13:49
Fahrschule