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 / 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
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 / 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>
@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"
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 / 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);
public class MvxActionBarActivity
: MvxActionBarEventSourceActivity
, IMvxAndroidView
{
public MvxActionBarActivity()
{
BindingContext = new MvxAndroidBindingContext(this, this);
this.AddEventListeners();
}
@Cheesebaron
Cheesebaron / calc.py
Created December 19, 2013 17:59
Just a stupid calculator
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 19 18:15:29 2013
@author: Tomasz
"""
import math, os
class Calc():
@Cheesebaron
Cheesebaron / DroidExtensions.cs
Created January 17, 2014 09:01
IMenuItem disabled color change.
public static class DroidExtensions
{
public static IMenuItem SetEnabled(this IMenuItem item, bool enabled, Context context, int iconId)
{
return item.SetEnabled(enabled, context, iconId, Color.Gray);
}
public static IMenuItem SetEnabled(this IMenuItem item, bool enabled, Context context, int iconId, Color disabledColor)
{
var resIcon = context.Resources.GetDrawable(iconId);
private NSObject _notification;
private float _scrollAmount;
private double _animationDuration;
private UIViewAnimationCurve _animationCurve;
public override void ViewDidLoad()
{
...
_notification = UIKeyboard.Notifications.ObserveWillShow((s, e) =>