This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
// Converts a hex, rgb, or rgba color string to Color object. Works with opacity values as well. | |
// e.g.: | |
// "#000" -> Color(0xff000000) | |
// "#cc3333" -> Color(0xffcc3333) | |
// "#cc3333dd" -> Color(0xddcc3333) | |
// "rgb(204, 44, 81)" -> Color(0xffcc2c51) | |
// "rgba(204, 44, 81, 0.20)" -> Color(0x33cc2c51) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*############################# | |
* Developer: Mohammad Sharaf Ali | |
* Designation: Web Developer | |
* Version: 1.0 | |
*/############################# | |
// SETTINGS | |
ini_set('max_execution_time', 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let calendar1 = Calendar(identifier: .gregorian) | |
if let date = DateComponents(calendar: calendar1, year: 1900, month: 1, day: 1, hour: 0, minute: 0, second: 0).date{ | |
print("test date \(date)") | |
let date2 = date.startOfYear2(); | |
print("test date2 \(date2)") | |
} | |
var components = DateComponents(timeZone: TimeZone(identifier: "UTC")!) | |
components.year = 1990 | |
components.month = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* JSON Web Token implementation | |
* | |
* Minimum implementation used by Realtime auth, based on this spec: | |
* http://self-issued.info/docs/draft-jones-json-web-token-01.html. | |
* | |
* @author Neuman Vong <neuman@twilio.com> | |
*/ | |
class JWT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In a Firestore standard example, we quickly create a 'xmas tree' of nested stuff | |
// We use Promises directly: get().then(callback) and use snapshot.forEach() to iterate | |
let campaignsRef = db.collection('campaigns'); | |
let activeCampaigns = campaignsRef.where('active', '==', true).select().get() | |
.then(snapshot => { | |
snapshot.forEach(campaign => { | |
console.log(campaign.id); | |
let allTasks = campaignsRef.doc(campaign.id).collection('tasks').get().then( | |
snapshot => { | |
snapshot.forEach(task => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:http/http.dart' as http; | |
import 'dart:convert' as convert; | |
class BackendService { | |
static Future<List<Map<String, String>>> getSuggestions(String query) async { | |
if (query.isEmpty && query.length < 3) { | |
print('Query needs to be at least 3 chars'); | |
return Future.value([]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_typeahead/flutter_typeahead.dart'; | |
import 'data.dart'; | |
class MyMaterialApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Datamuse Autocomplete Demo', | |
home: MyHomePage(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:typed_data'; | |
import 'package:flutter/material.dart'; | |
import 'package:pdf/pdf.dart'; | |
import 'package:pdf/widgets.dart' as pw; | |
import 'package:printing/printing.dart'; | |
Future<void> main() async { | |
runApp(const MyApp('Printing Demo')); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: danielcastro | |
* Date: 2/2/17 | |
* Time: 2:06 PM | |
* | |
* Place under app/paht/to/file folder and add | |
* "files" : [ | |
* "app/paht/to/file/helpers.php" |
NewerOlder