Skip to content

Instantly share code, notes, and snippets.

@naixx
naixx / DarkStructureEnhance2.js
Created June 29, 2024 01:36
DarkStructureEnhance script adapted to process container. Useful for solar imaging
/*
DarkStructureEnhance v1.1
A script for enhancement of dark structures.
Copyright (C) 2009 Carlos Sonnenstein (PTeam) & Oriol Lehmkuhl (PTeam)
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, version 3 of the License.
// ==UserScript==
// @name Aliexpress
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://trade.aliexpress.ru/orderList.htm*
// @match https://trade.aliexpress.com/orderList.htm*
// @match https://trade.aliexpress.ru/order_list.htm*
// @match https://trade.aliexpress.com/order_list.htm*
@naixx
naixx / log
Created October 2, 2015 11:48
10-02 07:47:23.388: W/AudioTrack(13527): AUDIO_OUTPUT_FLAG_FAST denied by client
10-02 07:47:23.391: V/TEST(15689): bac16402-14aa-43c1-9606-23c87a7c41a0
10-02 07:47:23.397: I/ActivityManager(13527): START u0 {act=android.intent.action.MAIN cmp=cactusvpn.app/de.blinkt.openvpn.LaunchCVPN (has extras)} from uid 10081 on display 0
10-02 07:47:23.411: I/Vpn(13527): Switched from [Legacy VPN] to cactusvpn.app
10-02 07:47:23.411: D/Vpn(13527): setting state=IDLE, reason=prepare
10-02 07:47:23.650: D/TaskPersister(13527): removeObsoleteFile: deleting file=257_task.xml
10-02 07:47:23.928: W/ActivityManager(13527): Activity pause timeout for ActivityRecord{14d9ec0f u0 cactusvpn.app/de.blinkt.openvpn.LaunchCVPN t259 f}
10-02 07:47:25.546: E/=== Dismiss 6(15689): false-Intent { cmp=cactusvpn.app/de.blinkt.openvpn.core.OpenVPNService (has extras) }-1
10-02 07:47:25.546: I/+++ Th(15689): Starting openvpn
10-02 07:47:25.547: I/OpenVPN(15689): Starting openvpn
class A: DatabaseClass{
}
fun <reified T : DatabaseClass> T.Default.query() = myAwesomeQuery(javaClass<T>())
A.query()
@naixx
naixx / Readme.md
Last active November 7, 2022 15:32
Kotlin ternary operator

Motivation

Kotlin is very expressive language, but like Scala it lacks of ternary operator. Currently language provided alternative if looks a bit verbose.

val result = if (myExpression) 1 else 2

Compared to a classical Java or C++ variant

int result = myExpression ? 1 : 2
01-29 23:46:14.174 5894-5894/? D/AndroidRuntime﹕ >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
01-29 23:46:14.174 5894-5894/? D/AndroidRuntime﹕ CheckJNI is OFF
01-29 23:46:14.182 5894-5894/? D/dalvikvm﹕ Trying to load lib libjavacore.so 0x0
01-29 23:46:14.185 5894-5894/? D/dalvikvm﹕ Added shared lib libjavacore.so 0x0
01-29 23:46:14.189 5894-5894/? D/dalvikvm﹕ Trying to load lib libnativehelper.so 0x0
01-29 23:46:14.189 5894-5894/? D/dalvikvm﹕ Added shared lib libnativehelper.so 0x0
01-29 23:46:14.227 5894-5894/? D/dalvikvm﹕ Note: class Landroid/app/ActivityManagerNative; has 159 unimplemented (abstract) methods
01-29 23:46:14.372 5894-5894/? D/AndroidRuntime﹕ Calling main entry com.android.commands.pm.Pm
01-29 23:46:14.375 849-870/? D/MotDevicePolicyManager﹕ Version:02.00.00
01-29 23:46:14.375 849-870/? W/PackageManager﹕ Package named 'com.saurik.impactor.payload_1391028371' doesn't exist.
--------- beginning of /dev/log/system
01-29 22:55:26.030 848 1265 I ActivityManager: Start proc com.android.vending for broadcast com.android.vending/com.google.android.finsky.receivers.PackageMonitorReceiver$RegisteredReceiver: pid=3588 uid=10084 gids={50084, 3003, 1015, 1028}
01-29 22:55:26.086 848 858 I ActivityManager: No longer want com.amazon.kindle (pid 2931): empty #29
01-29 22:55:26.088 1180 1343 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1173 android.content.ContextWrapper.sendBroadcast:338 com.motorola.motocare.util.TriggerHelper$TriggerBuilder.send:76 com.motorola.motocare.internal.frameworkevents.ProcessKillTrigger.sendTrigger:147 com.motorola.motocare.internal.frameworkevents.ProcessKillTrigger.handleFrameworkEvent:164
01-29 22:55:26.115 848 1253 V ConnectivityService: enforceCheckPermissionforHiPri:Pid=3588ret=false