Skip to content

Instantly share code, notes, and snippets.

View DamianSuess's full-sized avatar
👍
Enjoying every day

Damian DamianSuess

👍
Enjoying every day
View GitHub Profile
@DamianSuess
DamianSuess / ThreadBgWorker.cs
Created October 22, 2016 20:26
Thread Background Worker
namespace XI.Template
{
using System.ComponentModel;
class ThreadTest
{
#region Constructor and attributes
private System.ComponentModel.BackgroundWorker _thread;
@DamianSuess
DamianSuess / DroidTelephonySimInfo.cs
Last active January 28, 2022 22:02
Get Android's SIM ICC Id and device's IMEI number
// Requires the following permission in your AndroidManifest.xml
// <uses-permission android:name="android.permission.READ_PHONE_STATE" />
using System.Collections.Generic;
using Android.Telephony;
// ...
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
@DamianSuess
DamianSuess / DroidBluetoothConnectAsync.cs
Last active September 12, 2016 00:43
Android connect to Bluetooth device asynchronously
/*
Source:
https://forums.xamarin.com/discussion/30055/connecting-to-a-bluetooth-scanner-with-xamarin-android#Comment_94845
The problem relates to device.GetUuids. You are assuming the Uuid is what you
want with ElementAt(0). What you need is a loop inside your foreach, like in
the following testing, that the device supports the Bluetooth Serial Port Profile
*/
ParcelUuid[] uuids = device.GetUuids();
@DamianSuess
DamianSuess / MainActivity.cs
Created September 9, 2016 17:14
Android - Enforce Screen Orientation
namespace TestApp.Droid
{
[Activity(Label = "TestApp",
Icon = "@drawable/icon",
Theme = "@style/MyTheme",
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation,
NoHistory = true)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
@DamianSuess
DamianSuess / MainActivity.cs
Last active September 9, 2016 17:17
Android - Remove Title and Notification bars
namespace TestApp.Droid
{
[Activity(Label = "myApp",
MainLauncher = true,
Icon = "@drawable/Icon",
ScreenOrientation = ScreenOrientation.Landscape)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
@DamianSuess
DamianSuess / osx_uninstall_mysql_install_mariadb_homebrew.md
Created March 18, 2016 14:56 — forked from brandonsimpson/osx_uninstall_mysql_install_mariadb_homebrew.md
OSX How To: Uninstall native MySQL and install MariaDB via Homebrew

OSX How To: Uninstall native MySQL and install MariaDB via Homebrew

This is a short overview on how to completely remove any old mysql server installs in OSX and upgrade to MariaDB without conflicts. Things can get a bit weird when you have various old installs of MySQL server floating around, and utilizing homebrew to install and upgrade MariaDB as a drop in replacement for MySQL has worked well, especially if you're used to managing MySQL installs via yum in linux.

First: Backup Your Data!

Backup all of your current databases with mysqldump

This isn't a tutorial on backups, and there are many ways to do it. You should know how to backup your data anyway. For this example, we'll do a full backup of our InnoDB databases.