Skip to content

Instantly share code, notes, and snippets.

/*
Copyright (c) 2012 Wes Lanning, http://codingcreation.com
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
class MainActivity
extends BaseActivity
with LoaderCallbacks[SharedPreferences] {
private var dbOnly : Boolean = false
private var enableDebug : Boolean = false
private var filteredSignals: Array[String] = null
private var fudgeSignal : Boolean = true
private var preferences : SharedPreferences = null
private var sigInfoIds : TypedArray = null
@yareally
yareally / MyActivity.scala
Last active August 29, 2015 14:08
Scala features being used on Android
package com.example.android_scala
import android.app.Activity
import android.os.Bundle
import android.view.View
import android.view.View.OnClickListener
import android.widget.{Button, Toast}
import com.example.android_scala.MyActivity._
class MyActivity extends Activity {
@yareally
yareally / override.ini
Last active August 29, 2015 14:05
making search results work correctly on google
Opera Preferences version 2.1
; Do not edit this file while Opera is running
; This file is stored in UTF-8 encoding
; This file is found under c:/users/<username>/appdata/roaming/opera/opera/override.ini
; ~/.opera/ on linux
; or wherever you installed opera (if using the portible version)
; Firefox version was set to version somewhat farther in the future to avoid it not working again anytime soon (version 51)
; add the following lines if they do not already exist to the file:
[Overrides]
@yareally
yareally / dialogs.yml
Created August 22, 2014 00:56
Opera 12.12 dialog layout
########## DEFINITIONS ##########
definitions:
widgets:
DoNotShowAgainCheckBox: &DoNotShowAgainCheckBox
type: Checkbox
name: checkbox_Default
string: S_DO_NOT_SHOW_DIALOG_AGAIN
buttons:
# Ok button, typically used in a button strip using *OkButton
@yareally
yareally / dialogs.yml
Created August 21, 2014 10:32
Edit of dialogs.yml for Opera 12 so the startup dialog gives an option to go in offline mode or online mode to avoid loading every tab. The part that was added is the 2 radio buttons in the last StackLayout. Some reason checkbox does not work (yet), but radios do and good enough.
- type: Dialog
name: Startup Dialog
title: D_STARTUP_TITLE
content:
type: StackLayout
name: MainView
elements:
- type: StackLayout # pending proper solution, see DSK-343111
orientation: horizontal
bottom-margin: 16
@yareally
yareally / SQLiteHelper.cs
Created July 8, 2014 10:54
Wrapper around the .net SQLite library to make working with it easier.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Helpers.Storage
{
@yareally
yareally / conversation_activity.xml
Last active August 29, 2015 14:02
xml for fixing the send button
<!-- old xml -->
<EditText
android:id="@+id/embedded_text_editor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:autoText="true"
android:capitalize="sentences"
android:background="#00ffffff"
android:padding="12dp"
@yareally
yareally / ConversationActivity.java
Last active August 29, 2015 14:02
fixes the send button
// original code:
private void initializeIme() {
if (TextSecurePreferences.isEnterImeKeyEnabled(this)) {
composeText.setInputType(composeText.getInputType() & (~InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE));
} else {
composeText.setInputType(composeText.getInputType() | (InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE));
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Helpers.Storage;
using UnityEngine;
namespace Test
{