Skip to content

Instantly share code, notes, and snippets.

View supercurio's full-sized avatar
🌱

François Simond supercurio

🌱
View GitHub Profile
private fun getAllWifiSubnetIpAddresses(): List<InetAddress> {
val wifiMgr = getSystemService(WIFI_SERVICE) as WifiManager
val wlanAddr = NetworkUtils.intToInetAddress(wifiMgr.dhcpInfo.ipAddress)
return NetworkInterface.getNetworkInterfaces().toList()
.flatMap { it.interfaceAddresses }
.filter { it.address == wlanAddr }
.map { SubnetUtils(it.address.hostAddress + "/" + it.networkPrefixLength) }
.flatMap { it.info.allAddresses.asList() }
.map { Inet4Address.getByName(it) }
@supercurio
supercurio / gist:1493568
Created December 18, 2011 14:24
git merge from android-samsung-2.6.35-gingerbread to android-samsung-3.0-ics-mr1
curio@carton:~/dev/voodoo/nexuss$ git checkout android-samsung-2.6.35-gingerbread-for-merge
Switched to branch 'android-samsung-2.6.35-gingerbread-for-merge'
curio@carton:~/dev/voodoo/nexuss$ git merge android-samsung-3.0-ics-mr1
Auto-merging virt/kvm/kvm_main.c
Removing usr/initramfs_data.lzo.S
Removing usr/initramfs_data.lzma.S
Removing usr/initramfs_data.gz.S
Removing usr/initramfs_data.bz2.S
Removing tools/perf/util/newt.c
Auto-merging tools/perf/util/callchain.h
package com.levelup.foxyring;
import android.content.Context;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.database.Cursor;
import java.util.Map;
import android.util.Log;