This is a gist used in the following blog posts:
This file contains 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 firebase_admin | |
from firebase_admin import credentials | |
from firebase_admin import firestore | |
from firebase_admin import auth | |
# Download the service account json from Project Setting > Service Accounts Generate Private Key | |
service_account = 'project.json' | |
cred = credentials.Certificate(service_account) | |
firebase_admin.initialize_app(cred) | |
for user in auth.list_users().iterate_all(): |
This file contains 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
pipeline = [ | |
{ | |
'$lookup': { | |
'from': 'students', | |
'as': 'studentArray', | |
'pipeline': [ | |
{ | |
'$sort': { | |
'balance_coins': -1 | |
} |
This file contains 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
[ +146 ms] executing: uname -m | |
[ +58 ms] Exit code 0 from: uname -m | |
[ ] x86_64 | |
[ +10 ms] executing: [/home/droid/Tools/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H | |
[ +18 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H | |
[ ] 3595343e20a61ff16d14e8ecc25f364276bb1b8b | |
[ +1 ms] executing: [/home/droid/Tools/flutter/] git tag --points-at 3595343e20a61ff16d14e8ecc25f364276bb1b8b | |
[ +88 ms] Exit code 0 from: git tag --points-at 3595343e20a61ff16d14e8ecc25f364276bb1b8b | |
[ ] 2.5.2 | |
[ +16 ms] executing: [/home/droid/Tools/flutter/] git rev-parse --abbrev-ref --symbolic @{u} |
This file contains 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
TextFormField( | |
keyboardType: keyboard, | |
controller: controller, | |
maxLines: lines, | |
decoration: InputDecoration( | |
//contentPadding: EdgeInsets.all(12), | |
hintText: placeholder, | |
enabledBorder: border, | |
prefixIcon: SizedBox( | |
child: Center( |
This file contains 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
testWidgets("Show error text widget when future returns error", | |
(WidgetTester tester) async { | |
Future<List<Contact>>? future; | |
final contactsScreen = MaterialApp( | |
home: buildContactList( | |
contacts: future, | |
), | |
); | |
await tester.pumpWidget(contactsScreen); | |
await tester.pumpAndSettle(); |
This file contains 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
#Edit /etc/pulse/default.pa and add the following text at the bottom (Just what's between the ---- lines) | |
load-module module-echo-cancel source_name=noechosource sink_name=noechosink | |
set-default-source noechosource | |
set-default-sink noechosink | |
# pulseaudio -k |
This file contains 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
// Function to test // | |
Future<List<Contact>> fetchContacts(http.Client client) async { | |
final response = await client.get(Uri.parse(url)); | |
if (response.statusCode == 200) { | |
if (json.decode(response.body).toString().length > 2) { | |
List jsonResponse = json.decode(response.body); | |
return jsonResponse.map((e) => Contact.fromJson(e)).toList(); | |
} else { | |
throw Exception('Failed to load contacts'); | |
} |
This file contains 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
#include <stdio.h> | |
int maxOneRow(int array[][16],int r,int c) { | |
int currentRowCounter=0; | |
int maxOneRow = 0; | |
int maxRowCounter = 0; | |
int i=0,j = 0; | |
for(i;i<r;i++) { | |
for(j;j<c;j++) { | |
if(array[i][j]==1) { |
NewerOlder