Skip to content

Instantly share code, notes, and snippets.

View akbarsha03's full-sized avatar
🎯
I just keep trying

Akbarsha M akbarsha03

🎯
I just keep trying
View GitHub Profile
@akbarsha03
akbarsha03 / MTMR Preset
Created February 28, 2020 13:17
MTMR Preset
[
{
"type": "exitTouchbar",
"align": "left",
"width": 48,
"title": "",
"image": {
"base64": "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAC91JREFUeNrtnW2wVlUVx//7XsQUUIFEqQCDEuxlJs0XZDLB0FK0aSwLFO1zaWR+dUZn+tjUNH5ztLDAN9SZmtAYGQmmmlJ8HQURmmSSEJom4erFEu7114d9nnh6vC9nnbP32ed57vnNPMMHzj17rbXX2S9r77221NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0ND7uNQCVAUwRdIMSVOy3/TsX0k6IulQ9u8RSW85546klrkKes4BgJmSLpJ0jqSzs98iSWcaX3VA0u7st0fSLknPOOfeSq1jSLreAbIv+2JJy7PfuZL6Ihb5uqSnWj/n3KHUNphwACcD1wObgCHScQx4AlgFnJTaLj0PsBRYC7ydsNJHYyCT7dLUduopgD7gGuCZ1DVs4CXgJqA/tf26lqzirwN2pq7NEuzIHGFSant2FcDlwO7UtReQXcCXUtu19gCzgXWpaysiG4E5qe3cTszpUm6AfuA2+Tn3janlicjVknYAtwK1sH3yOAAwS9J6SVeklqVitkq6wTl3IKUQSR0AWC7pfklnRCzmfUlvyEfz9uh4yPeQpMHsmak6HhqeLh89XChpbmQbHZB3gq0Ry6gf+BH+D4HhCP3sW8CvgDXA5ygRoAFOAs7N3vVr4FAEeYeAO+vSJUQHOBF4JLAR3wR+DJxPxLk3fqxyAfAT4EBgHR4EJqeun6gA04CnAhnsGLABuDJmpY+
@akbarsha03
akbarsha03 / tiltable_stack.dart
Created August 5, 2019 15:51 — forked from Schwusch/tiltable_stack.dart
A tiltable stack, an idea originated from 2dimensions
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class TiltableStack extends StatefulWidget {
final List<Widget> children;
final Alignment alignment;
const TiltableStack({
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AndroidLauncherScript : MonoBehaviour {
void OnGUI() {
if (GUI.Button(new Rect(10, 70, 200, 30), "Launch react native activity")) {
Debug.Log("Button clicked");
var unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}
import React from 'react';
import { AppRegistry, StyleSheet, Text, View } from 'react-native';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>Open up index.js to start working on your app!</Text>
<Text>Changes you make will automatically reload.</Text>
<Text>Shake your phone to open the developer menu.</Text>
{
"name": "sampleReactApp",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "26.0.0",
"react-native-scripts": "1.13.1",
"react-test-renderer": "16.3.0-alpha.1"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
@akbarsha03
akbarsha03 / ReactNativeActivity.java
Last active September 9, 2021 02:44
A simple react native activity
package com.sample.reactapp;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.view.KeyEvent;
import android.widget.Toast;
fun getSenderNameForNougat(dialog: QBChatDialog?, message: QBChatMessage) =
if (dialog?.isPrivate != false) "" else {
val name = message.getProperty(AppConst.QB.QB_MSG_SENDER_NAME)?.let { it }?.toString()
?: MemberRealm.getContactInfo(message.senderId)?.name ?: ""
name.takeIf { it.isNotEmpty() } ?: ""
fun main(args: Array<String>) {
RequestBody(null, 25)
}
data class RequestBody(val name: String?, val age: Int?) {
init {
checkNotNull(name) {
"This can't be null" // Custom message for IllegalStateException