This file contains 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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override |
This file contains 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
#pragma version(1) | |
#pragma rs java_package_name(com.liewjuntung.image) | |
rs_allocation inImage; | |
int inWidth; | |
int inHeight; | |
float rotation = 0.0f; |
This file contains 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
class RgbConversion(val rs: RenderScript, private val feedSize: Size, private val hasRotate: Boolean = true) { | |
private var mInputAllocation: Allocation? = null | |
private var mOutputAllocation: Allocation? = null | |
private var mRotatedAllocation: Allocation? = null | |
private val yuvToRgb = ScriptIntrinsicYuvToRGB.create(rs, Element.U8_4(rs)) | |
private val rotator = ScriptC_rotator(rs) | |
var bufferCallback: ((ByteBuffer) -> Unit)? = null | |
val inputSurface: Surface | |
get() = mInputAllocation!!.surface |
This file contains 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
#!/bin/bash | |
git config --global alias.lg "log --oneline --decorate --all --graph" | |
git config --global alias.s "status -s" | |
git config --global pull.rebase true | |
git config --global rerere.enabled true | |
git config --global user.name "Liew Jun Tung" | |
git config --global user.email pandawarrior91@gmail.com |
This file contains 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
animation_button.setOnClickListener { | |
it.apply { | |
val transition = ChangeBounds() | |
transition.duration = 2000L | |
TransitionManager.beginDelayedTransition(constraint_parent_view, transition) | |
when { | |
translationX == 0f -> translationX = 450f | |
translationX < 0f -> translationX = 0f | |
translationX > 0f -> translationX = -450f | |
} |
This file contains 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 UIKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
let json = "{\n \"a\": \"a\",\n \"a_\": \"a_\",\n \"a_a\": \"a_a\",\n \"a_a_\": \"a_a_\",\n \"a_a_a\": \"a_a_a\",\n \"a_a_a_\": \"a_a_a_\",\n \"a_a_a_a\": \"a_a_a_a\",\n \"a_a_a_a_\": \"a_a_a_a_\",\n \"a_a_a_a_a\": \"a_a_a_a_a\",\n \"a_a_a_a_a_\": \"a_a_a_a_a_\",\n \"a_a_a_a_a_a\": \"a_a_a_a_a_a\",\n \"a_a_a_a_a_a_\": \"a_a_a_a_a_a_\",\n \"a_a_a_a_a_a_a\": \"a_a_a_a_a_a_a\",\n \"a_a_a_a_a_a_a_\": \"a_a_a_a_a_a_a_\",\n \"a_a_a_a_a_a_a_a\": \"a_a_a_a_a_a_a_a\",\n \"a_a_a_a_a_a_a_a_\": \"a_a_a_a_a_a_a_a_\",\n \"a_a_a_a_a_a_a_a_a\": \"a_a_a_a_a_a_a_a_a\",\n \"a_a_a_a_a_a_a_a_a_\": \"a_a_a_a_a_a_a_a_a_\",\n \"a_a_a_a_a_a_a_a_a_a\": \"a_a_a_a_a_a_a_a_a_a\",\n \"a_a_a_a_a_a_a_a_a_a_\": \"a_a_a_a_a_a_a_a_a_a_\",\n \"a_a_a_a_a_a_a |
This file contains 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
class Dog { | |
String name; | |
int age; | |
Dog(this.name, this.age); | |
} | |
class DogHouse { | |
Dog dog; | |
DogHouse(this.dog); |
This file contains 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
void main(){ | |
var map = {"a": "b"}; | |
var map2 = {"b": "c"}; | |
print({...map, ...map2, "c": "d"}); | |
var list = ["a", "b"]; | |
var list2 = ["c", "d"]; | |
print([...list, ...list2, "f", "g"]); | |
} |
This file contains 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/material.dart'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains 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
class Dog { | |
String name; | |
int age; | |
Dog(this.name, this.age); | |
} | |
class Cat { | |
String name; | |
int age; |
NewerOlder