Skip to content

Instantly share code, notes, and snippets.

View mangowi's full-sized avatar
💪
C#, ASP.NET MVC, Core, Java and JavaScript(VueJS and React)

Daniel Mangowi mangowi

💪
C#, ASP.NET MVC, Core, Java and JavaScript(VueJS and React)
View GitHub Profile
@mangowi
mangowi / React-Native-WebView-Cookies.js
Created May 24, 2020 14:09 — forked from kanzitelli/React-Native-WebView-Cookies.js
React Native Trick: Get Cookies of WebView without using any native modules such as react-native-cookies. Might be helpful for getting JWT while making OAuth2 👽
// @flow
import React, { Component } from 'react';
import {
WebView,
} from 'react-native';
class LoginScreen extends Component {
state = {
cookies : {},
@mangowi
mangowi / althosting.txt
Created May 23, 2020 18:22 — forked from sdiama/althosting.txt
A curated list of cheap "alternatives" to AWS, GCP, Azure hosting solutions
S3 Alternatives
---------------
- https://wasabi.com
- https://www.exoscale.com
- https://www.vultr.com
- https://www.arubacloud.com/
- https://www.digitalocean.com
- https://min.io/
- http://leo-project.net/
@mangowi
mangowi / webview.js
Created May 23, 2020 18:14 — forked from sdiama/webview.js
React Native: Handle hardware back button @ webview
import React, { Component } from 'react';
import { WebView, BackHandler } from 'react-native';
export default class WebViewMoviezSpace extends Component {
constructor(props) {
super(props);
this.WEBVIEW_REF = React.createRef();
}
componentDidMount() {
@mangowi
mangowi / MySQL8.0-Visual-Studio-2019-EntityFramework-Guide.md Installing MySQL 8.0 Server with EntityFramework in Visual Studio 2019

Installing MySQL 8.0 Server with EntityFramework in Visual Studio 2019

  • Install MySQL Server 8.0.16
  • Install Complete MySQL Connector.Net x86 8.0.16
  • Install this custom repacked VSIX MySQL Visual Studio
  • If after installing MySQL Visual Studio Plugin it shows warning that failed to execute comamnd devenv /updateconfiguration, then manually execute that command in Developer Command Prompt for Visual Studio 20xx with run as administrator.
  • Run this command Install-Package EntityFramework in Visual Studio Nuget package manager console
  • Manage Nuget Packages > Search Mysql > install Mysql.Data v8.0.16
  • Manage Nuget Packages > Search Mysql > install Mysql.Data.Entity v6.10.8
  • Manage Nuget Packages > Search Mysql.Data.EntityFramework > install Mysql.Data.EntityFramework v8.0.16
@mangowi
mangowi / MySQL8.0-Visual-Studio-2019-EntityFramework-Guide.md Installing MySQL 8.0 Server with EntityFramework in Visual Studio 2019

Installing MySQL 8.0 Server with EntityFramework in Visual Studio 2019

  • Install MySQL Server 8.0.16
  • Install Complete MySQL Connector.Net x86 8.0.16
  • Install this custom repacked VSIX MySQL Visual Studio
  • If after installing MySQL Visual Studio Plugin it shows warning that failed to execute comamnd devenv /updateconfiguration, then manually execute that command in Developer Command Prompt for Visual Studio 20xx with run as administrator.
  • Run this command Install-Package EntityFramework in Visual Studio Nuget package manager console
  • Manage Nuget Packages > Search Mysql > install Mysql.Data v8.0.16
  • Manage Nuget Packages > Search Mysql > install Mysql.Data.Entity v6.10.8
  • Manage Nuget Packages > Search Mysql.Data.EntityFramework > install Mysql.Data.EntityFramework v8.0.16
@mangowi
mangowi / favicon.php
Created November 14, 2019 08:17 — forked from ifthenelse/favicon.php
favicon html code for all browsers (got from http://www.sitepoint.com/favicon-a-changing-role/ )
<?php $favicon_path = "/docroot/img/ico/"; ?>
<!-- Default -->
<link rel="shortcut icon" href="<?php echo $favicon_path; ?>favicon.ico"/>
<!-- For IE6+ -->
<link rel="shortcut icon" href="<?php echo $favicon_path; ?><?php echo $favicon_path; ?>favicon.ico" type="image/x-icon">
<!-- For IE6+ -->
<link rel="shortcut icon" href="<?php echo $favicon_path; ?>favicon.ico">
@mangowi
mangowi / DomainTemplateRoute - GetVirtualPath
Created October 30, 2019 11:31 — forked from maartenba/DomainTemplateRoute - GetVirtualPath
ASP.NET MVC 6 / ASP.NET 5 Domain Routing + Tenant Middleware
public string GetVirtualPath(VirtualPathContext context)
{
foreach (var matcherParameter in _matcher.Template.Parameters)
{
context.Values.Remove(matcherParameter.Name); // make sure none of the domain-placeholders are appended as query string parameters
}
return _innerRoute.GetVirtualPath(context);
}
@mangowi
mangowi / sw.js
Created August 1, 2019 10:09 — forked from ireade/sw.js
Handle broken images with the service worker
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open("precache").then((cache) => cache.add("/broken.png"))
);
});
function isImage(fetchRequest) {
return fetchRequest.method === "GET" && fetchRequest.destination === "image";
}
@mangowi
mangowi / service-workers.md
Created June 23, 2019 20:00 — forked from Rich-Harris/service-workers.md
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@mangowi
mangowi / ussd.cs
Created June 15, 2019 07:14 — forked from JaniKibichi/ussd.cs
USSD on c#
/*
A few things to note about USSD:
USSD is session driven. Every request we send you will contain a sessionId, and this will be maintained until that session is completed
You will need to let the Mobile Service Provider know whether the session is complete or not. If the session is ongoing, please begin your response with CON. If this is the last response for that session, begin your response with END.
If we get a HTTP error response (Code 40X) from your script, or a malformed response (does not begin with CON or END, we will terminate the USSD session gracefully.
using visual studio 2013 or Greater
go to file > new > project
in the projects window choose web under C#
select ASP.NET Web Application and name your project as you like