Skip to content

Instantly share code, notes, and snippets.

View chamithchathuka's full-sized avatar
🏠
Working from home

Chamith Chathuka chamithchathuka

🏠
Working from home
View GitHub Profile
@RequestMapping("/socialshare")
void handleUpdate(HttpServletResponse response,@RequestHeader("User-Agent") String os) throws IOException {
System.out.println(os);
if (Pattern.compile(Pattern.quote("Android"), Pattern.CASE_INSENSITIVE).matcher(os).find())
response.sendRedirect("https://play.google.com/store/apps/details?id=com.rezgcorp.powerworld&hl=en");
else if (Pattern.compile(Pattern.quote("iPhone"), Pattern.CASE_INSENSITIVE).matcher(os).find()) {
response.sendRedirect("https://apps.apple.com/us/app/power-world-access-app/id1514909558");
} else {
## Allow anonymous users to connect, default is 'off'. !!NOTE!!
## Enabling this completely disables authentication of the clients and
## should only be used for testing/development purposes or in case
## clients are authenticated by some other means.
##
## Default: off
##
## Acceptable values:
## - on or off
allow_anonymous = off
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter for Beginners',
home: Scaffold(