Skip to content

Instantly share code, notes, and snippets.

View umuieme's full-sized avatar

Umesh Basnet umuieme

View GitHub Profile
@umuieme
umuieme / FileUtils.java
Created July 18, 2018 05:51
Utility method related to file manipulation
public class FileUtils {
public static String getDataFromAsset(Context context, String fileName) {
String data = "";
BufferedReader in = null;
try {
InputStream inputStream = context.getAssets().open(fileName);
StringBuilder buf = new StringBuilder();
in = new BufferedReader(new InputStreamReader(inputStream));
String str;
package com.aabumu.genericadapter.usingbinding
import android.databinding.BaseObservable
import android.databinding.DataBindingUtil
import android.databinding.ViewDataBinding
import android.support.v7.widget.RecyclerView
import android.util.Log
import android.view.LayoutInflater
import android.view.ViewGroup
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
class ZigZagClipper extends CustomClipper<Path> {
ClipType clipType;
ZigZagClipper(this.clipType);
@override
Path getClip(Size size) {
Path path = Path(); // the starting point is the 0,0 position of the widget.
path.lineTo(0, size.height); // this draws the line from current point to the left bottom position of widget
path.lineTo(size.width, size.height); // this draws the line from current point to the right bottom position of the widget.
class _EventContentState extends State<EventContent> with AutomaticKeepAliveClientMixin<> {
final String url = 'https://furnishmenow.co.za/wp-json/wp/v2/posts'; // Testing url
List data;
Future<String> getEventContentData() async{
var res = await http.get(Uri.encodeFull(url), headers: { "Accept": "applications/json"});
setState(() {
var resBody = json.decode(res.body);
data = resBody;
function sendNotifiction($title, $message){
$header = array(
"authorization: key=YOUR_FIREBASE_KEY",
"content-type: application/json",
);
$data = array
(
'title' => $title,
[
{
"id": "18",
"name": "TestBook",
"price": "200.00",
"author": "Aryan1",
"category": "Sci-Fi",
"language": "en",
"ISBN": "123-00023",
"publish_date": "2019-04-05",
import 'package:flutter/material.dart';
class CustomRRect extends CustomClipper<Path> {
CustomRRect();
@override
Path getClip(Size size) {
var path = new Path();
path.lineTo(0.0, size.height/2 - 20);
<html>
<body>
<h1> test </h1>
<p> this whould open the link <a href="fb-messenger://share?app_id=58567469885&redirect_uri=https%3A%2F%2Fwww.bbc.com%2Fnepali%2Fnews-51798024&link=https%3A%2F%2Fwww.bbc.com%2Fnepali%2Fnews-51798024%3FCMP%3Dshare_btn_me">link to messange</a> </p>
</body>
</html>
@umuieme
umuieme / ffmpeg-snippets.md
Created April 20, 2020 16:28 — forked from martinruenz/ffmpeg-snippets.md
ffmpeg snippets / cheatsheet