Skip to content

Instantly share code, notes, and snippets.

View KasperKnop's full-sized avatar

Kasper Knop Rasmussen KasperKnop

  • Aarhus, Denmark
View GitHub Profile
@KasperKnop
KasperKnop / main_activity.xml
Created February 24, 2022 14:13
A Trip To Singapore! (Solution)
<androidx.constraintlayout.widget.ConstraintLayout
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"
android:id="@+id/activity_main_done"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_editor_absoluteX="0dp"
app:layout_editor_absoluteY="80dp"
tools:layout_editor_absoluteX="0dp"
@KasperKnop
KasperKnop / MainActivity.java
Last active October 5, 2020 17:17
Solution to Exercise 3-5 - Expecting Results
public class MainActivity extends AppCompatActivity {
TextView replyTextView;
TextView replyReceived;
EditText messageEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
public class MainActivity extends AppCompatActivity {
private static final String CHANNEL_ID = "123";
NotificationManagerCompat notificationManager;
NotificationCompat.Builder builder;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@KasperKnop
KasperKnop / PlantDAO.java
Created December 1, 2019 15:16
Refactoring example
public class PlantDAO {
private Database db;
public PlantDAO() {
db = Database.getInstance();
}
public void createPlant(IPlant plant) {
db.update(Queries.CREATE_PLANT, plant.getId(), plant.getProfile().getId(), plant.getName());
}
@KasperKnop
KasperKnop / readme.txt
Last active June 30, 2019 22:25
Sokoban
Play this game by pasting the script in http://www.puzzlescript.net/editor.html