Skip to content

Instantly share code, notes, and snippets.

@oed
oed / battery.lua
Created July 20, 2014 14:43
Battery widget for awesome
local io = io
local math = math
local beautiful = require("beautiful")
local naughty = require("naughty")
local wibox = require("wibox")
local awful = require("awful")
local tonumber = tonumber
local tostring = tostring
local print = print
local pairs = pairs

Keybase proof

I hereby claim:

  • I am oed on github.
  • I am oed (https://keybase.io/oed) on keybase.
  • I have a public key whose fingerprint is 20FB 1CF2 AEBE C8C7 40FA 628F 8974 700F 6DFA 6977

To claim this, I am signing this object:

Verifying that +oed is my blockchain ID. https://onename.com/oed
0x258DDD84abf61ba1D1E39f95D8863ee9ca218c06
### Keybase proof
I hereby claim:
* I am oed on github.
* I am oed (https://keybase.io/oed) on keybase.
* I have a public key whose fingerprint is 20FB 1CF2 AEBE C8C7 40FA 628F 8974 700F 6DFA 6977
To claim this, I am signing this object:
@oed
oed / lolgist
Created December 6, 2018 14:17
asdfasdfasdfasdf
// Option 1: Set public space data, if 3Box is chosen as default
livepeerSpace.public.set('defaultProfile', '3box')
// OR
// Option 2: Set public space data, if your app is chosen as default
livepeerSpace.public.set('defaultProfile', 'livepeer')
const box = await Box.openBox(<eth-address>)
const boxSyncPromise = new Promise((resolve, reject) => box.onSyncDone(resolve))
let livepeerSpace
const spaceSyncPromise = new Promise((resolve, reject) => {
livepeerSpace = await box.openSpace('livepeer', { onSyncDone: resolve })
})
await boxSyncPromise
await spaceSyncPromise
const livepeerProfile = await Box.getSpace(<eth-address>, 'livepeer')
console.log(livepeerProfile.defaultProfile)
// Set the public app profile data
livepeerSpace.public.set('defaultProfile', 'livepeer')
livepeerSpace.public.set('name', 'yourname')
const imageObject = [{
"@type":"ImageObject",
"contentUrl": "<https://ipfs.infura.io/ipfs/><ipfs-hash-of-image>",
"cid": {"/":"<ipfs-hash-of-image>"}
}]
livepeerSpace.public.set('image', imageObject)
livepeerSpace.public.set('url', '<https://yoursite.com>')