Skip to content

Instantly share code, notes, and snippets.

View Cheesebaron's full-sized avatar
🧀
Send cheese please

Tomasz Cielecki Cheesebaron

🧀
Send cheese please
View GitHub Profile
@Cheesebaron
Cheesebaron / gist:7040789
Created October 18, 2013 12:25
Google Charts QR Code generation.
async void Main()
{
var content = "Hello, World!";
var size = QRCodeSize.Large;
var errorCorrection = QRErrorCorrection.H;
var qrUrl = GenerateQRCodeUrl(content, size, errorCorrection);
qrUrl.Dump();
var image = await GetQRCodeImage(qrUrl);
Remote build step failed. [C:\ENM\Main\src\prod\Mobile\SetupCompanion\SetupCompanion.iOS\SetupCompanion.iOS.csproj]
Response status: Error [C:\ENM\Main\src\prod\Mobile\SetupCompanion\SetupCompanion.iOS\SetupCompanion.iOS.csproj]
warning MT3005: The dependency 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' of the assembly 'Cirrious.CrossCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e16445fd9b451819' was not found. Please review the project's references. [C:\ENM\Main\src\prod\Mobile\SetupCompanion\SetupCompanion.iOS\SetupCompanion.iOS.csproj]
warning MT3006: Could not compute a complete dependency map for the project. This will result in slower build times because Xamarin.iOS can't properly detect what needs to be rebuilt (and what does not need to be rebuilt). Please review previous warnings for more details. [C:\ENM\Main\src\prod\Mobile\SetupCompanion\SetupCompanion.iOS\SetupCompanion.iOS.csproj]
warning MT3005: The dependency 'System.Windows, Version=2.0.5.0, C
@Cheesebaron
Cheesebaron / Home.xml
Last active December 19, 2015 18:29
A couple of code snippets for a blog post about Fragments, ViewPager and MvvmCross.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<dk.ostebaronen.droid.viewpagerindicator.TitlePageIndicator
android:id="@+id/viewPagerIndicator"
android:padding="10dip"
@Cheesebaron
Cheesebaron / AndroidManifest.xml
Last active December 31, 2017 18:10
Quick and dirty list of WiFi AP's and connect to it. Only WPA/WPA2 tested.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="dk.ostebaronen.wifishizniz" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:targetSdkVersion="17" />
<application android:label="WiFiShizniz"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
</manifest>
using Android.Views;
using Android.Widget;
namespace ListViewWithHeaders.Items
{
public class Header : IItem
{
public string HeaderName { get; set; }
public View GetView(LayoutInflater inflater, View convertView)
@Cheesebaron
Cheesebaron / Main.xml
Created June 10, 2013 21:04
Just a simple PopupMenu sample.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/MyButton"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Click Me!" />
<ImageView
@Cheesebaron
Cheesebaron / BackShizzle.cs
Created May 31, 2013 13:36
Super hacky hack for forcing showing the Back button in the NavigationBar on iOS. Why does it work?
public override void ViewWillAppear(bool animated)
{
base.ViewWillAppear(animated);
NavigationItem.SetHidesBackButton(true, false);
NavigationController.NavigationBar.SetNeedsDisplay();
}
public override void ViewDidAppear(bool animated)
{
NavigationItem.SetHidesBackButton(false, true);
@Cheesebaron
Cheesebaron / gist:5684336
Created May 31, 2013 11:15
Quick and dirty menu item.
public override bool OnCreateOptionsMenu(IMenu menu)
{
var item = menu.Add(0,1,1,"Back");
//If you want an icon set it here
item.SetIcon(Resource.drawable.ic_menu_back);
return true;
}
public override bool OnOptionsItemSelected(IMenuItem item)
{
@Cheesebaron
Cheesebaron / Activity1.cs
Last active September 15, 2020 14:21
Sample showing how to use Spannables to replace text with Images in Mono for Android.
using Android.App;
using Android.Text;
using Android.Text.Style;
using Android.Widget;
using Android.OS;
namespace MonoDroid.TextViewWithImages
{
[Activity(Label = "Text with Images", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
@Cheesebaron
Cheesebaron / Activity1.cs
Created February 25, 2013 12:52
Just a sample for Krish on the MonoDroid mailing list.
using System;
using System.IO;
using System.Text;
using System.Xml;
using Android.App;
using Android.Widget;
using Android.OS;
namespace MonoDroid.ReadWriteXML
{