Skip to content

Instantly share code, notes, and snippets.

View av's full-sized avatar
💻
🌚

Ivan Charapanau av

💻
🌚
View GitHub Profile
@av
av / examples.md
Created August 27, 2020 09:29
thng-query examples

Sample queries

thngs with name Advanced* where identifiers.ser^673
products named Robot*
thngs tagged "offline"
products where customFields.weight > 42

Programmatic use

@av
av / Component.js
Created August 26, 2020 09:24
Root Component class from an unreleased UI framework
var HIDE_CLASS = 'ui-hidden';
var DISABLED_CLASS = 'ui-disabled';
var FOCUSABLE_GRABBER = ':tabbable:visible:first';
ui.component = ui.define({
id: null,
cls: null,
locator: null,
hidden: false,
@av
av / main.dart
Created January 13, 2020 18:44
Flutter: neu
import 'package:flutter/material.dart';
void main() => runApp(NeumorphicApp());
class NeumorphicApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Neumorphic App',
theme: ThemeData(
@av
av / main.dart
Created January 13, 2020 18:40
Flutter: neu
// Before
child: Container(
//...
// After
// ...
child: AnimatedContainer(
duration: const Duration(milliseconds: 150),
// ...
@av
av / main.dart
Created January 13, 2020 18:38
Flutter: neu
// In _NeumorphicContainerState.build > Listener > Container > BoxDecoration
// ...
colors: [
_isPressed ? color : color.mix(Colors.black, .1),
_isPressed ? color.mix(Colors.black, .05) : color,
_isPressed ? color.mix(Colors.black, .05) : color,
color.mix(Colors.white, _isPressed ? .2 : .5),
],
// ...
@av
av / main.dart
Created January 13, 2020 18:27
Flutter: neu
// In _NeumorphicContainerState.build > Listener > Container > BoxDecoration
// ...
color: color.mix(Colors.black, .05),
// ...
@av
av / main.dart
Last active January 13, 2020 18:33
Flutter: neu
// In _NeumorphicContainerState.build > Listener > Container > BoxDecoration
boxShadow: _isPressed ? null : [...]
// ...
@av
av / main.dart
Created January 13, 2020 18:18
Flutter: neu
// Converting NeumorphicContainer to a StatefulWidget
class NeumorphicContainer extends StatefulWidget {
final Widget child;
final double bevel;
final Offset blurOffset;
final Color color;
NeumorphicContainer({
Key key,
this.child,
@av
av / main.dart
Created January 13, 2020 18:04
Flutter: neu
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
color.mix(Colors.black, .1),
color,
color,
color.mix(Colors.white, .5),
],
stops: [
@av
av / main.dart
Created January 13, 2020 18:00
Flutter: neu
// ...
padding: const EdgeInsets.all(24.0),
// ...