Skip to content

Instantly share code, notes, and snippets.

View talamaska's full-sized avatar

Zlati Pehlivanov talamaska

View GitHub Profile
@slightfoot
slightfoot / nested_tabs.dart
Created February 17, 2019 02:43
Example Nested Tab Layout - 17th Feburary 2019
import 'package:flutter/material.dart';
void main() => runApp(ExampleApp());
class ExampleApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Example Nested Tab Layout',
theme: ThemeData(
@slightfoot
slightfoot / nav.dart
Last active April 16, 2020 18:43
Advanced Nav Demo - 7th November 2018 - #HumpdayQandA https://twitter.com/i/status/1060322027993776128
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
// -----------------------------------------------------------------------------
void main() => runApp(NavApp());
class NavApp extends StatefulWidget {
@override
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@buntagonalprism
buntagonalprism / Dart Class.dart
Last active April 2, 2023 12:22
Flutter and Dart collection of file templates for Android Studio development
#set( $nameparts = $NAME.split("_"))
#set( $namepart = '')
#set( $classname = '')
#foreach( $namepart in $nameparts )
#set( $classname = $classname + $namepart.substring(0, 1).toUpperCase() + $namepart.substring(1))
#end
class $classname {
// TODO: add class properties and methods
import { Component, OnInit, ViewChild, Input } from '@angular/core';
import { MatPaginator, MatSort } from '@angular/material';
import { NgxDataTableDataSource } from './ngx-data-table-datasource';
@Component({
selector: 'ngx-data-table',
templateUrl: './ngx-data-table.component.html',
styleUrls: ['./ngx-data-table.component.css']
})
export class NgxDataTableComponent {
import { Directive, ElementRef, forwardRef, Input, Renderer2 } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { fromEvent } from 'rxjs/observable/fromEvent';
import { merge } from 'rxjs/observable/merge';
import { timer } from 'rxjs/observable/timer';
import { Subscription } from 'rxjs/Subscription';
export const DEFAULT_VALUE_ACCESSOR : any = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => NgControlOptionsDirective),
@tomastrajan
tomastrajan / app.component.ts
Last active May 2, 2022 06:02
Angular Material Theming - overlay handling
import { OverlayContainer } from '@angular/cdk/overlay';
export class AppComponent implements OnInit {
// use this to set correct theme class on app holder
// eg: <div [class]="themeClass">...</div>
themeClass: string;
constructor(
private overlayContainer: OverlayContainer
@arniebradfo
arniebradfo / any.component.html
Last active May 16, 2023 18:05
Angular *ngFor recursive list tree template
<h1>Angular 2 Recursive List</h1>
<ul>
<ng-template #recursiveList let-list>
<li *ngFor="let item of list">
{{item.title}}
<ul *ngIf="item.children.length > 0">
<ng-container *ngTemplateOutlet="recursiveList; context:{ $implicit: item.children }"></ng-container>
</ul>
</li>
</ng-template>
@ivosabev
ivosabev / 0 Readme.md
Last active May 12, 2017 08:27
The Hitchhiker's Guide to the Galaxy of React - Sample Code

In a few simple steps we will create an app that has a link with a counter that increases every time we click it.

We will start with very low and rudementary implementation of a store and with each example evolve it to reach a basic Flux and then Redux implementation.

  1. Global variable - single component
  2. Global variable - multiple components
  3. Props
  4. State
  5. Flux
  6. Redux
@ccnokes
ccnokes / preload-example.js
Created February 1, 2017 03:03
Electron preload script
// in preload scripts, we have access to node.js and electron APIs
// the remote web app will not have access, so this is safe
const { ipcRenderer: ipc, remote } = require('electron');
init();
function init() {
// Expose a bridging API to by setting an global on `window`.
// We'll add methods to it here first, and when the remote web app loads,
// it'll add some additional methods as well.