bundle init
vi Gemfile
source "https://rubygems.org"
| import React, { useEffect } from "react"; | |
| type ToastProps = { | |
| message: string; | |
| show: boolean; | |
| setShow: React.Dispatch<React.SetStateAction<boolean>>; | |
| }; | |
| const Toast: React.FC<ToastProps> = ({ message, show, setShow }) => { | |
| useEffect(() => { |
| import 'package:flutter/material.dart'; | |
| class CustomCircleAvatar extends StatelessWidget { | |
| const CustomCircleAvatar( | |
| {Key? key, required this.height, required this.width, required this.url}) | |
| : super(key: key); | |
| final double height; | |
| final double width; | |
| final String url; |
| import 'package:flutter/material.dart'; | |
| enum ScreenType { | |
| desktop, | |
| tablet, | |
| handset, | |
| watch, | |
| } | |
| class FormFactor { |
| // 4515 seconds to | |
| // (60 * 60 * 1) + (15 * 60) + (15) | |
| // 01:15:15 | |
| class Utilities { | |
| static String formatTime(int seconds) { | |
| return '${(Duration(seconds: seconds))}' | |
| .split('.')[0] | |
| .padLeft(8, '0'); | |
| } | |
| } |
| import requests | |
| import json | |
| import calendar | |
| from datetime import datetime, timedelta | |
| _token = "your token here" | |
| _domain = "your domain here" | |
| if __name__ == '__main__': | |
| while 1: |
| for f in *.png | |
| do | |
| # Process to get File Name & 2x, 3x file names | |
| xNAME=`echo "$f" | cut -d'.' -f1` | |
| cp "$f" "$xNAME@3x.png" | |
| cp "$f" "$xNAME@2x.png" | |
| # Set proper resolution to original file | |
| sips -s dpiHeight 72.0 -s dpiWidth 72.0 "$f" |
| // Swift 2 | |
| // try will throw an error if there any & | |
| // catch will directly catch with 'error' | |
| let str:String? = NSBundle.mainBundle().pathForResource("IndiaPost", ofType: "json") | |
| let data:NSData? = NSData(contentsOfFile: str!) | |
| do { | |
| let jsonData:AnyObject? = try NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.AllowFragments) |
| cp 1024x1024.png AppIcon-20.png | |
| sips -Z 20 AppIcon-20.png | |
| cp 1024x1024.png [email protected] | |
| sips -Z 40 [email protected] | |
| cp 1024x1024.png [email protected] | |
| sips -Z 60 [email protected] | |
| cp 1024x1024.png AppIcon-29.png |