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
[versions] | |
com-android-application = "8.1.0-alpha11" | |
org-jetbrains-kotlin-android = "1.7.20" | |
core-ktx = "1.9.0" | |
junit = "4.13.2" | |
androidx-test-ext-junit = "1.1.3" | |
espresso-core = "3.4.0" | |
lifecycle-runtime-ktx = "2.3.1" | |
activity-compose = "1.5.1" | |
compose-bom = "2022.10.00" |
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 kotlin.io.*; | |
/* | |
Verify whether a long text is following the order rule defined in order string. For example the order string is "abcd", which means "a" can't appear at any position after "b", "c" and "d" in the text, "b" can't appear at any position after "c" and "d" in the text and "c" can't appear at any position after "d" in the text. if the text is "axubbxcxxdx", then the text didn't follow the rule, since "b" appears after "c" in substring "cxb" | |
a : 1 | |
x : 11 | |
b : 8 | |
c : 7 |
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
@Composable | |
fun HelloScreen() { | |
var name by rememberSaveable { mutableStateOf("") } | |
HelloContent(name = name, onNameChange = { name = it }) | |
} | |
@Composable | |
fun HelloContent(name: String, onNameChange: (String) -> Unit) { | |
Column(modifier = Modifier.padding(16.dp)) { |
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 androidx.compose.runtime.Composable | |
class TodoActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val datainfo = DataInfo("Lucas", "lucas.m@email.com") | |
setContent { | |
MyTheme { | |
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
[alias] | |
# Change and update local master branch | |
m = !git checkout master && git pull && git fecth -p | |
# Change and update local develop branch | |
d = !git checkout develop && git pull && git fecth -p | |
# View abbreviated SHA, description, and history graph of the latest 20 commits | |
l = log --pretty=oneline -n 20 --graph --abbrev-commit |
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
TypeError: Cannot read property 'trim' of undefined | |
1 anonymous | |
/Users/lucasmarciano/Documents/Projetos/personal/adonisjs/test-backend/node_modules/@adonisjs/fold/src/Registrar/index.js:104 | |
2 arrayMap | |
/Users/lucasmarciano/Documents/Projetos/personal/adonisjs/test-backend/node_modules/lodash/lodash.js:639 | |
3 Function.map |
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
<?php | |
class MyUserClass | |
{ | |
public function getUserList() | |
{ | |
$dbconn = new DatabaseConnection('localhost','user','password'); | |
if ($dbconn->connect_error) { | |
// Supondo que a classe DatabaseConnection tenha tratado as funções de erro no banco | |
die("Conexão falhou: " . $dbconn->connect_error); | |
$dbconn->close(); |
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
<? | |
/*Codigo original*/ | |
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) { | |
header("Location: http://www.google.com"); | |
exit(); | |
} elseif (isset($_COOKIE['Loggedin']) && $_COOKIE['Loggedin'] == true) { | |
header("Location: http://www.google.com"); | |
exit(); | |
} | |
?> |
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
<?php | |
for ($i = 1; $i <= 100; $i++){ | |
if(divisorCinco($i) && divisorTres($i)){ | |
echo "<p>FizzBuzz</p>"; | |
}elseif (divisorCinco($i)){ | |
echo "<p>Buzz</p>"; | |
}elseif(divisorTres($i)){ | |
echo "<p>Fizz</p>"; | |
}else{ | |
echo "<p>{$i}</p>"; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<RelativeLayout | |
android:id="@+id/activity_main" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.inthecheesefactory.lab.databinding.MainActivity"> |
NewerOlder