Skip to content

Instantly share code, notes, and snippets.

Mirko Stocker misto

Block or report user

Report or block misto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@misto
misto / gist:1758655
Created Feb 7, 2012
Scala Trait linearization
View gist:1758655
Welcome to Scala version 2.9.1.r0-b20120125223512 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_02).
Type in expressions to have them evaluated.
Type :help for more information.
scala> trait A
defined trait A
scala> trait C extends A
defined trait C
View osm.java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Context ctx = getApplicationContext();
Configuration.getInstance().load(ctx, PreferenceManager.getDefaultSharedPreferences(ctx));
setContentView(R.layout.activity_main);
map = findViewById(R.id.map);
map.setTileSource(TileSourceFactory.MAPNIK);
map.setMaxZoomLevel(20);
@misto
misto / MyActivity.java
Last active Aug 11, 2016
Scan and Decode QR-Code
View MyActivity.java
public void takeQrCodePicture() {
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setCaptureActivity(MyCaptureActivity.class);
integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
integrator.setOrientationLocked(false);
integrator.addExtra(Intents.Scan.BARCODE_IMAGE_ENABLED, true);
integrator.initiateScan();
}
@Override
View build.gradle
dependencies {
...
compile 'com.journeyapps:zxing-android-embedded:3.3.0'
}
View MyCaptureActivity.java
import com.journeyapps.barcodescanner.CaptureActivity;
public class MyCaptureActivity extends CaptureActivity { }
@misto
misto / search-menu-plugin.xml
Created Mar 16, 2016
Adding an entry to Eclipse's Search Menu
View search-menu-plugin.xml
<extension point="org.eclipse.ui.actionSets">
<actionSet
description="Scaps Search Actions"
id="org.scala-search.actionSet"
label="Scaps Search Actions"
visible="true">
<menu
label="Search"
path="navigate"
View EclipseDevelopment.md

Scala

Build

Eclipse

View gist:4673334
overloaded method value tuple with alternatives: [A1(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in
method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method
tuple), A2(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method
tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple),
A3(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in
method tuple)(in method tuple), A4(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in
method tuple)(in method tuple), A5(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in method tuple)(in
method tuple)(in met
View gist:4016494
package ch.appquest.imagepuzzle;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
View gist:4016595
Uri uri = /*URI an der die Kamera-App das Foto abgelegt hat*/
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(uri, "image/*");
You can’t perform that action at this time.