This file contains hidden or 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
Show hidden characters
| { | |
| "root": true, | |
| "ignorePatterns": ["projects/**/*"], | |
| "parser": "@typescript-eslint/parser", | |
| "parserOptions": { | |
| "project": "tsconfig.json", | |
| "sourceType": "module" | |
| }, | |
| "overrides": [ | |
| { |
This file contains hidden or 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 deepCopy(obj) { | |
| if (typeof obj !== 'object' || obj === null) { | |
| return obj; | |
| } | |
| const isArray = Array.isArray(obj); | |
| const copy = isArray ? [] : {}; | |
| const stack = [{ source: obj, target: copy }]; | |
This file contains hidden or 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
| [alias] | |
| # Prints current branch | |
| cbr=rev-parse --abbrev-ref HEAD | |
| # prints the branches sorted by commit date and coloured | |
| br=branch --sort=-committerdate --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate |
This file contains hidden or 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
| // sample usage: https://stackblitz.com/edit/angular-ivy-lvhg5u?file=src%2Fapp%2Ftwo-way-binder.directive.ts | |
| // <input type="text" id="sample" [(appTwoWayBinder)]="name" /> | |
| import { | |
| Directive, | |
| EventEmitter, | |
| HostBinding, | |
| HostListener, | |
| Input, | |
| OnChanges, |
This file contains hidden or 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
| /// Code based on https://stackoverflow.com/a/66938952 | |
| /// Usage Example | |
| /// String text = "Hello World"; | |
| /// String salt = 'Pl!309R@dM'; | |
| /// | |
| /// XorEncoder encoder = XorEncoder(salt); | |
| /// | |
| /// String encoded = encoder.encode(text); | |
| /// String decoded = encoder.decode(encoded); | |
| /// |
This file contains hidden or 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
| const path = require('path'); | |
| const cleanPlugin = require('clean-webpack-plugin'); | |
| const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
| module.exports = { | |
| mode: 'development', | |
| entry: './src/main.ts', | |
| output: { | |
| filename: 'bundle.js', | |
| path: path.resolve(__dirname, 'dist') |
This file contains hidden or 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
| CREATE (c:Computer {name: 'Andy',uid:'123'}) | |
| CREATE (d1:Drive {name: 'Drive1',capacity:"2gb",uid:'223'}) | |
| CREATE (d2:Drive {name: 'Drive2',capacity:"4gb",uid:'233'}) | |
| CREATE (f1:Folder {name: 'desktop',type:"special",uid:'323'}) | |
| CREATE (f2:Folder {name: 'mydocuments',type:"special",uid:'333'}) | |
| CREATE (f3:Folder {name: 'myprojects',type:"normal",uid:'343'}) | |
| CREATE (t1:File {name: 'text1',type:"txt",size:"1kb",uid:'423'}) | |
| CREATE (t2:File {name: 'text2',type:"txt",size:"1.5kb",uid:'433'}) | |
| CREATE (t3:File {name: 'text3',type:"txt",size:"2kb",uid:'443'}) |
This file contains hidden or 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
| flutter::FlutterEngine *newEngine = flutter_controller_->engine(); | |
| custom_channels::createChannelCalc x = custom_channels::createChannelCalc(newEngine); |
This file contains hidden or 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 'package:flutter/services.dart'; | |
| class AppPlatformChannel{ | |
| static Future<String> add(int a, int b) async{ | |
| const MethodChannel channel = MethodChannel('calc_channel'); | |
| try{ | |
| var result = await channel.invokeMethod('add', {'a': a, 'b': b}); | |
| return(result); | |
| }catch(e){ | |
| return(e.toString()); |
