Skip to content

Instantly share code, notes, and snippets.

@mathieulegrand
mathieulegrand / keyboard.cljs
Last active August 29, 2015 14:21
Editable DIV as a IRC style input bar (textarea replacement) in ClojureScript
(ns potato.keyboard
(:require [clojure.string]
[goog.dom]
[goog.style]
[goog.events]
[goog.dom.xml]
[goog.dom.classlist]
[goog.dom.selection]
[goog.testing.events]
[goog.events.EventTarget]
@mathieulegrand
mathieulegrand / FCPrivateBatteryStatus.m
Created January 30, 2016 03:01
How to get raw battery info (mAh remaining, etc.) from iOS using private APIs. For internal testing only, NOT APP STORE DISTRIBUTION!
#import <Foundation/Foundation.h>
#include <dlfcn.h>
NSDictionary *FCPrivateBatteryStatus()
{
static mach_port_t *s_kIOMasterPortDefault;
static kern_return_t (*s_IORegistryEntryCreateCFProperties)(mach_port_t entry, CFMutableDictionaryRef *properties, CFAllocatorRef allocator, UInt32 options);
static mach_port_t (*s_IOServiceGetMatchingService)(mach_port_t masterPort, CFDictionaryRef matching CF_RELEASES_ARGUMENT);
static CFMutableDictionaryRef (*s_IOServiceMatching)(const char *name);
@mathieulegrand
mathieulegrand / keybase.md
Created February 9, 2017 03:40
Keybase proof

Keybase proof

I hereby claim:

  • I am mathieulegrand on github.
  • I am legrand (https://keybase.io/legrand) on keybase.
  • I have a public key ASAeBLSEgh2mB8FtmCjY17Pu3cvzLJzFU_hRtNgfvq-SSwo

To claim this, I am signing this object: