Skip to content

Instantly share code, notes, and snippets.

View rohan20's full-sized avatar

Rohan Taneja rohan20

View GitHub Profile
@slightfoot
slightfoot / example.dart
Last active August 29, 2020 01:17
Staggered GridView with Example - by Simon Lightfoot - 19/08/2020
import 'package:flutter/material.dart';
import 'staggered_grid.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: HomeScreen(),
),
const MY_DOMAIN = 'rezaarkan.com';
const SLUG_TO_PAGE = {
'': '882cd6dd6e1e482d823b464f326213e5',
'now': '25b7df64071d420d8f609bf76d9f4114',
'portfolio': '6000547bed0d441793bfba1498c063e2',
'resume': '0934b80d2d1544f99dedadb00be9d146',
'recommendations': '29115129efa44f1a870f390dd2c0a6c0',
'photos': 'e78c0492a5ec486aa51f4cdb2c6f4603',
'blog': '29bb193c1a104ba2b832788b57d58cd6',
@matt-bertoncello
matt-bertoncello / Dockerfile
Created May 18, 2020 07:54
Dockerfile and python script to run selenium with headless chromedriver in debian docker container.
# define base image as python slim-buster.
FROM python:3.7-slim-buster as base
## start builder stage.
# this is the first stage of the build.
# it will install all requirements.
FROM base as builder
# install all packages for chromedriver: https://gist.github.com/varyonic/dea40abcf3dd891d204ef235c6e8dd79
@CodingDoug
CodingDoug / README.md
Created December 5, 2019 02:24
How to schedule a Cloud Function to run in the future (in order to build a Firestore document TTL)
@hjJunior
hjJunior / dio_test.dart
Created November 2, 2019 19:03
An example how to use mockito and Dio to tests your calls to API
class DioAdapterMock extends Mock implements HttpClientAdapter {}
const dioHttpHeadersForResponseBody = {
Headers.contentTypeHeader: [Headers.jsonContentType],
};
void main() {
group('UserRemoteDataSource', () {
final Dio dio = Dio();
import 'package:flutter/material.dart';
@immutable
class ClipShadowPath extends StatelessWidget {
final Shadow shadow;
final CustomClipper<Path> clipper;
final Widget child;
ClipShadowPath({
@required this.shadow,
@debuggerx01
debuggerx01 / visible_items_of_listview.dart
Last active April 8, 2024 07:07
Visible Items of ListView Demo
import 'package:flutter/material.dart';
import 'package:rect_getter/rect_getter.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Visible Demo',
@levelsio
levelsio / levelsio-by.html
Last active March 10, 2021 05:20
Maker Link (aka the @levelsio by link)
<!-- Maker Link by @levelsio -->
<!-- MIT License -->
<style>
body {
background:#333;
}
.levelsio-by {
font-family:"Helvetica Neue",sans-serif;
right:0;
@rodrigoborgesdeoliveira
rodrigoborgesdeoliveira / compareBackgroundWithResourceId.java
Last active November 12, 2021 22:36
Compare if a background of a view in android is equal to a specific resource id
// Comparing to a color
if (Objects.equals(view.getBackground().getConstantState(), activity.getResources().getDrawable(R.color.anyColor).getConstantState())) {
// Do what you have to do...
}
// Comparing to a drawable
if (Objects.equals(view.getBackground().getConstantState(), activity.getResources().getDrawable(R.drawable.anyDrawable).getConstantState())) {
// Do what you have to do...
}
@ilikerobots
ilikerobots / intl_locale_override.dart
Last active December 19, 2019 13:34
Example of overriding default locale for use with intl
import 'dart:async';
import 'package:intl/intl.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:intl_translate_example/l10n/messages_all.dart';
void main() => runApp(new MyApp());
class Translations {
static Future<Translations> load(Locale locale) {