Skip to content

Instantly share code, notes, and snippets.

View wackyapps's full-sized avatar
🎯
Focusing

Waqas Mahmood Khan wackyapps

🎯
Focusing
  • Itelc
  • Pakistan
View GitHub Profile
@d4n5h
d4n5h / DatetimePicker.vue
Last active August 18, 2021 04:16
Vuetify datetime picker
<template>
<div>
<v-menu
v-model="dialog"
:close-on-content-click="false"
:nudge-width="200"
max-width="290"
offset-y
>
<template v-slot:activator="{ on }">
@osaxma
osaxma / hasura_connect_ex.dart
Last active March 4, 2024 09:38
a workaround for keeping haura_connect subscriptions alive when using JWT
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:hasura_connect/hasura_connect.dart';
import 'package:http/http.dart' as http;
// problem:
// when subscribing to`HasuraConnect.subscription`, a websocket connection is created on the first subscription
// call. The websocket connection is created only once with the initial subscription and the provided TokenInterceptor
// or headers. When the token expires during an active subscription, HasuraConnect doesn't stop the subscription, or try
// to reconnect with the latest token in in the TokenInterceptor nor does it throw an error. It'll keep calling `onRequest`
@GavinRay97
GavinRay97 / index.md
Last active April 12, 2024 18:31
Hasura organization permissions

Introduction

This document outlines how to model a common organization-based permission system in Hasura. Let's assume that you have some table structure like the following:

Table Name Columns Foreign Keys
User id, name, email
Organization User id, user_id, organization_id user_id -> user.id, organization_id -> organization.id
Organization id, name
@smkhalsa
smkhalsa / fade_on_scroll.dart
Last active April 25, 2024 00:14
A Widget that automatically fades its child based on scroll position
import 'package:flutter/material.dart';
class FadeOnScroll extends StatefulWidget {
final ScrollController scrollController;
final double zeroOpacityOffset;
final double fullOpacityOffset;
final Widget child;
FadeOnScroll(
{Key key,
@branflake2267
branflake2267 / main.dart
Created April 16, 2018 01:18
Flutter - Using the Refresh Indicator
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@egyjs
egyjs / Direct Link of YouTube videos.md
Last active April 17, 2024 06:38
PHP API To get Direct Link of YouTube videos
@branflake2267
branflake2267 / main.dart
Created March 3, 2018 21:32
Flutter - Using the future builder with infinite list view.
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@eolant
eolant / Confirm.vue
Last active March 23, 2024 08:48
Vuetify Confirm Dialog component that can be used locally or globally
<template>
<v-dialog v-model="dialog" :max-width="options.width" :style="{ zIndex: options.zIndex }" @keydown.esc="cancel">
<v-card>
<v-toolbar dark :color="options.color" dense flat>
<v-toolbar-title class="white--text">{{ title }}</v-toolbar-title>
</v-toolbar>
<v-card-text v-show="!!message" class="pa-4">{{ message }}</v-card-text>
<v-card-actions class="pt-0">
<v-spacer></v-spacer>
<v-btn color="primary darken-1" text @click.native="agree">Yes</v-btn>
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(home: new FrostedDemo()));
}
class FrostedDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
@brentonhouse
brentonhouse / Hide and Show iOS keyboard with Appcelerator Alloy.md
Last active May 18, 2017 09:35
Hide/Show iOS keyboard w/ Appcelerator Alloy

Use the following code to hide and show the iOS keyboard and toolbar when using the keyboard toolbar buttons.