Skip to content

Instantly share code, notes, and snippets.

View aadesola's full-sized avatar

Ajayi Adesola Grace aadesola

View GitHub Profile
@aadesola
aadesola / AutoFix-VisualStudioFiles.ps1
Last active November 27, 2019 13:40 — forked from HowardvanRooijen/AutoFix-VisualStudioFiles.ps1
AutoFix-VisualStudioFiles.ps1 which formats and alphabetically organises elements in .config & .csproj files which commonly cause git merge conflicts
<#
.SYNOPSIS
Scans the solution folder (the parent of the .git folder) for all app.config, web.config and *.csproj files
and auto-formats them to minimise the possibility of getting merge conflicts based on the ordering of
elements within these files.
N.B. Use of this script is entirely at your own risk. We shall not be liable for any damage which may
result from using it.
@aadesola
aadesola / Code snippet from MainActivity.java
Created June 26, 2018 11:46 — forked from udacityandroid/Code snippet from MainActivity.java
Android for Beginners : Negative Number of Cups of Coffee Extra Challenge Solution
/**
* This method is called when the plus button is clicked.
*/
public void increment(View view) {
if (quantity == 100) {
// Show an error message as a toast
Toast.makeText(this, "You cannot have more than 100 coffees", Toast.LENGTH_SHORT).show();
// Exit this method early because there's nothing left to do
return;
}
@aadesola
aadesola / MainActivity.java
Created June 22, 2018 12:49 — forked from udacityandroid/MainActivity.java
Android for Beginners : Cookies Starting Code
package com.example.android.cookies;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
public class MainActivity extends AppCompatActivity {
@Override
@aadesola
aadesola / Method 1
Created June 19, 2018 09:42 — forked from udacityandroid/Method 1
Android Development for Beginners : Define a Method
private String createCalendarEventReminder(String eventName, String location, int minutesAway) {
String reminder = "You have an upcoming event in " + minutesAway + " minutes.";
reminder = reminder + " It is " + eventName + " held at " + location + ".";
return reminder;
}
/**
* This method displays the given price on the screen.
*/
private void displayPrice(int number) {
TextView priceTextView = (TextView) findViewById(R.id.price_text_view);
priceTextView.setText(NumberFormat.getCurrencyInstance().format(number));
}