Skip to content

Instantly share code, notes, and snippets.

Avatar

Adora Nwodo AdoraNwodo

View GitHub Profile
View index.ts
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const environment = pulumi.getStack();
const location = "WestEurope";
const resourceGroupName = "tutorial-rg";
const appservicePlanName = "tutorial-plan";
const storageAccountName = "tutorialstore";
const functionAppName = "tutorial-app";
View StoreList.cs
class Store
{
private List<string> storeProducts;
public Store()
{
storeProducts = new List<string>();
}
async Task<string> GetOrAddProduct(Product product)
{
View StoreList.cs
class Store
{
private List<string> storeProducts;
public Store()
{
storeProducts = new List<string>();
}
async Task<string> GetOrAddProduct(Product product)
{
View StoreWithSemaphore.cs
class Store
{
private static Semaphore semaphore = new Semaphore(1, 3);
// ...
async Task DoSomeWork()
{
try
{
View StoreWithMutex.cs
class Store
{
private static Mutex mutex = new Mutex();
private List<string> storeProducts;
public Store()
{
storeProducts = new List<string>();
}
View Store.cs
class Store
{
private double revenue;
private List<string> storeProducts;
public Store(RevenueGenerator generator)
{
revenue = generator.GenerateCurrentRevenue();
storeProducts = new List<string>();
}
View GalleryActivity.kt
class GalleryActivity : AppCompatActivity() {
private val PICK_IMAGE_REQUEST = 71
private var filePath: Uri? = null
private var firebaseStore: FirebaseStorage? = null
private var storageReference: StorageReference? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gallery)
View GalleryAndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adoranwodo.GalleryUploadTutorial">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
@AdoraNwodo
AdoraNwodo / activity_gallery.xml
Last active Apr 26, 2019
Layout for Gallery Activity - Uploading an Image to Firebase
View activity_gallery.xml
@AdoraNwodo
AdoraNwodo / script.js
Created Mar 23, 2019
Vue vixens script
View script.js
<script>
export default {
name: "App",
data() {
return {
themeSwitched: false
};
}
};
</script>