Skip to content

Instantly share code, notes, and snippets.

View tobiasstraub's full-sized avatar
:octocat:
tobiasstraub.com

Tobias Straub tobiasstraub

:octocat:
tobiasstraub.com
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tobiasstraub on github.
  • I am tobiasstraub (https://keybase.io/tobiasstraub) on keybase.
  • I have a public key ASDmtA1ORQe7zZ7EL86gNBlR2KhULH3qemBB3UVyBHKpkQo

To claim this, I am signing this object:

@tobiasstraub
tobiasstraub / MainPage.cs
Created November 5, 2016 06:21
How to get RGB Color from Pixel in UWP
using System;
using System.IO;
using System.Threading.Tasks;
using Windows.Graphics.Imaging;
using Windows.UI;
using Windows.UI.Xaml.Controls;
namespace Bitmap
{
public sealed partial class MainPage : Page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Mein Seitentitel</title>
</head>
<body>
Mein sichtbarer Inhalt.
</body>
</html>
@tobiasstraub
tobiasstraub / commitcollective-cla.md
Last active December 6, 2015 09:09
CommitCollective Individual Contributor License Agreement

CommitCollective Individual Contributor License Agreement v1.0

Thank you for your interest in contributing to open source projects which are provided and powered by the CommitCollective. This document clarifies the terms under which you may make contributions, which includes any source code, bug fixes, configuration changes, documents or any other kind of materials do you commit to any project owned or managed by the CommitCollective. If you have any questions about this Agreement, please contact us at legal@storyinfect.com. You accept and agree to the following terms apply to all of your past, present and future contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

License
CommitCollective projects are each released under the terms of the individual licenses, which you can find in the project repositories or, if no seperate license is specified, under the terms of the Apache License Version 2.0 (http://ww

@tobiasstraub
tobiasstraub / BubblesortVersionSwapBreak.java
Created October 27, 2015 15:57
Example Implementation of traditional Bubblesort
/*
* Tobias Straub
* hello@tobiasstraub.com
* http://www.tobiasstraub.com
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/.
*/
package bubblesortversionswapbreak;
@tobiasstraub
tobiasstraub / BubblesortVersionElementSaving.java
Created October 27, 2015 15:56
Example Implementation for optimized Bubblesort
/*
* Tobias Straub
* hello@tobiasstraub.com
* http://www.tobiasstraub.com
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/.
*/
package bubblesortversionelementsaving;
for(int i=0; i<myStringList.size(); i++) {
myDoubleList.add(Double.parseDouble(myStringList.get(i)));
}
@tobiasstraub
tobiasstraub / Dialog.java
Created November 22, 2014 14:24
Android: Dialog with positive and negative Button
AlertDialog.Builder builder = new AlertDialog.Builder(getApplicationContext());
builder.setTitle(R.string.dialog_title);
builder.setMessage(R.string.dialog_message);
builder.setPositiveButton(R.string.dialog_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO: Do something, when user click on the positive button
}
});
builder.setNegativeButton(R.string.dialog_no, new DialogInterface.OnClickListener() {
@tobiasstraub
tobiasstraub / ButtonListener.java
Created November 22, 2014 14:16
Android: OnClickListener for Button onClick event
Button aButton = (Button) findViewById(R.id.theButton); // Id of the Button in the Activity layout
aButton.setOnClickListener(new OnClickListener() {
@Override // Override from OnClickListener class
public void onClick(View v) {
// TODO: What should happen when the button is clicked?
}
});
@tobiasstraub
tobiasstraub / CheckGPSProvider.java
Created November 22, 2014 14:07
Android: Check for GPS Provider is enabled, when not start Setting Activity to activate GPS
if (!((LocationManager) getSystemService(LOCATION_SERVICE)).isProviderEnabled(LocationManager.GPS_PROVIDER)) {
Toast.makeText(getApplicationContext(), R.string.activate_gps, Toast.LENGTH_LONG).show();
startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));
}