Skip to content

Instantly share code, notes, and snippets.

Big problems affecting society (well, actually me) that I'd like to solve:
* Asteroid detection, climate API, tourism API, - https://gsafas.secure.force.com/apply
* Life operations and survival (earn a living) dominate time spent by mass of people
* People lose contact with friends and family over years, even though they'd like to stay in touch (aka "life happens")
* People stop learning about things beyond their immediate work and social circle
* Car drivers are not pre-trained to reflexively handle accidents (e.g. through simulators)
* Genuine browsing and data privacy for internet users worldwide
* Cut out bureaucratic fat in democracy through technology
* Society depends on money for self-justification
<!DOCTYPE html>
<html>
<head>
<style>
#sq0 {
left: 300px;
top: 350px;
z-index: -250;
background: red;
}
@cmdr2
cmdr2 / janusUserList.py
Created September 4, 2015 09:23
Python script to periodically log the user list of JanusVR using an Android phone (use SL4A with Python). This allows the logger bot to operate 24 hours a day from my phone, instead of stopping when I close my laptop.
import android
import sys
import json
import time
import datetime
import socket
from threading import Timer
f = open("janus_users.txt", 'w', 0)
var net = require('net');
var client = net.connect(55566, "spyd.junkonet.org", function() {
log('CLIENT: Connected');
var logonMsg = JSON.stringify({"method":"logon","data":{"userId":"SomethingOne4Bot","version":"40.3","roomId":"test_room"}});
log("CLIENT: " + logonMsg);
client.write(logonMsg + "\r\n");
});
client.setEncoding('utf8');
void Update() {
if (Input.touchCount > 0) {
foreach (Touch t in Input.touches) {
if (t.phase == TouchPhase.Moved) {
if (t.position.x < Screen.width * 0.5f && handType == HandType.HOUR_HAND) {
leftCube.SetActive(true);
rightCube.SetActive(false);
} else if (t.position.x > Screen.width * 0.5f && handType == HandType.MINUTE_HAND) {
leftCube.SetActive(false);
rightCube.SetActive(true);
@cmdr2
cmdr2 / ExoPlayerExample.java
Created August 1, 2016 15:32
An example of using ExoPlayer from scratch
package org.cmdr2.exoplayerbridge;
import android.app.Activity;
import android.media.AudioManager;
import android.media.MediaCodec;
import android.net.Uri;
import android.util.Log;
import android.view.Surface;
import android.view.SurfaceView;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using WebSocketSharp;
/**
* a reference client for the fakedaydreamcontroller
* by cmdr2 <secondary.cmdr2@gmail.com>
*
@cmdr2
cmdr2 / colorclassifier.go
Last active April 23, 2018 06:19
Simple classifier (no libraries) to label RGB colors
package main
import (
"fmt"
"math"
"net/http"
"strconv"
"sort"
)
@cmdr2
cmdr2 / fun_smartphone.js
Last active November 14, 2019 15:56
Access to the full power of a smartphone to a javascript file, with the simplest (least-verbose) possible API of what a "smartphone" is. Probably scary, and some parts might not be possible yet.
var acc = require('imu');
var camera = require('camera');
var file = require('file');
var notification = require('notification');
var vibrate = require('vibrate');
var led = require('led');
var location = require('location');
var sms = require('sms');
var contacts = require('contacts');
// by cmdr2, anyone is free to use and modify this, without the need to give credit
const satellite = require('satellite.js'); // https://www.npmjs.com/package/satellite.js
const SunCalc = require('suncalc'); // https://www.npmjs.com/package/suncalc
var satrec = satellite.twoline2satrec('1 71066C 20001A 20014.19313215 -.01059873 00000-0 -43936-2 0 145',
'2 71066 52.9993 1.7743 0000976 92.9471 326.1492 15.86148217 16');
var stdMag = 4.7; // for Starlink-2