Skip to content

Instantly share code, notes, and snippets.

#!/Users/prafulla/miniconda2/bin/python
# path for python
# give exc permission
# -*- coding: utf-8 -*-
#to read cvs execell etc
import pandas
#get file from : https://drive.google.com/open?id=0B_P-kZ2NQv5aZWNSYUR2b2VrbFE
dataset = pandas.read_csv('50_Startups.csv')
class ViewController: UIViewController {
var userInterfaceStyle: UIUserInterfaceStyle?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
userInterfaceStyle = self.traitCollection.userInterfaceStyle
setupUI()
}
@prafullakumar
prafullakumar / BlurDemo.dart
Last active March 12, 2020 09:55
Dart: Blur effect
import 'dart:ui';
import 'package:flutter/material.dart';
class FrostedDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Scaffold(
body: Center (
child: Stack(
children: <Widget>[
@prafullakumar
prafullakumar / MultiLineTextViewSwiftUI.swift
Created April 4, 2020 06:08
Multiline Content Fit TextField
import SwiftUI
struct ContentView: View {
static var test:String = ""
static var testBinding = Binding<String>(get: { test }, set: { test = $0 } )
var body: some View {
NavigationView {
VStack(alignment: .leading) {
Text("Enter Review Comments:")
MultilineTextField("Type here", text: ContentView.testBinding, onCommit: {
@prafullakumar
prafullakumar / loginPage.dart
Last active January 4, 2021 18:38
Flutter: Demo login page
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',
@prafullakumar
prafullakumar / main.dart
Created April 12, 2020 06:56
show any kind of toast with example
import 'package:flutter/material.dart';
import 'toast.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Toast',
struct TextView: UIViewRepresentable {
//enum to define keyboard or input view handeling will be done in coorinator later
enum PickerType {
case keyboard(type: UIKeyboardType)
case datePicker(minDate: Date, maxDate: Date)
case customList(list: [String])
}
var pickerType: TextView.PickerType
final class Coordinator: NSObject {
var text: Binding<String>
var pickerType: TextView.PickerType
init(text: Binding<String>, pickerType: TextView.PickerType) {
self.pickerType = pickerType
self.text = text
}
//
// ContentView.swift
// newUI
//
// Created by prafull kumar on 3/4/20.
// Copyright © 2020 prafull kumar. All rights reserved.
//
import SwiftUI
@prafullakumar
prafullakumar / AdaptsKeyboard.swift
Created April 16, 2020 15:08
Demo - Keyboard Animation with Form SwiftUI
import SwiftUI
import Combine
struct KeyboardProperty {
var currentHeight: CGFloat = 0
var animationDuration: Double = 0
//keyboard notification also gives UIKeyboardAnimationCurveUserInfoKey using which we can completly sync keyboard animation with Scrollview move but In SwiftUI I cannot find any way to use the same.
}