This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Arcy's vim environment (based on perky's) | |
let g:Arcy="4.7" | |
let mapleader="\<Space>" | |
set nocompatible | |
"set fileformat=unix | |
set formatoptions=tcql | |
set ai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while :; do | |
read LINE | |
[ -z "${LINE}" ] && exit | |
IMAGE=$(echo ${LINE} |sed -e 's#.* "GET /v2/\(.*\)/manifests/\(.*\) HTTP/1.0" .*#\1@\2#') | |
echo ${IMAGE} | |
oc image mirror --filter-by-os="linux/amd64" registry.from.com/${IMAGE} registry.my.com/${IMAGE%@*} | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Joystick.h> | |
#define COLS 4 | |
#define ROWS 4 | |
#define PINS COLS+ROWS | |
#define BTNS COLS*ROWS | |
#define BTNCOUNT 12 | |
// Pins 1-7 of the keypad connected to the Arduino respectively: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"9c6cf1e1.8e009","type":"ibmiot out","z":"759e2a0c.e57d04","authentication":"boundService","apiKey":"91fe8e33.3d3f7","outputType":"cmd","deviceId":"+","deviceType":"badge2018","eventCommandType":"led","format":"json","data":"default","qos":0,"name":"IBM IoT - led","service":"registered","x":630,"y":160,"wires":[]},{"id":"d62d81b7.a9c39","type":"inject","z":"759e2a0c.e57d04","name":"Yellow LED Toggle","topic":"","payload":"{\"d\":{\"target\":\"red\",\"action\":\"toggle\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":160,"wires":[["5198c38b.5b95bc"]]},{"id":"bb2e3be3.23af08","type":"debug","z":"759e2a0c.e57d04","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":610,"y":220,"wires":[]},{"id":"ee682306.e8f7d","type":"comment","z":"759e2a0c.e57d04","name":"LED Command","info":"","x":180,"y":120,"wires":[]},{"id":"64d02863.c76408","type":"inject","z":"759e2a0c.e57d04","name":"Yellow LED On","topic":"","payload":"{\"d\":{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conf = Config('ibmiot') | |
conf.data | |
{'authToken': 'badge2365818', 'orgID': 'quickstart', 'deviceType': 'badge2018', 'user': 'use-token-auth', 'deviceID': '30AEA4151D58'} | |
conf.data['orgID'] = 'My Organization ID' | |
conf.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rx = machine.RMT(rmt_mode=machine.RMT.RX, channel=4, clk_div=80, pin=machine.Pin(26), mem_block_num=4) | |
rx.config(filter_en=True, filter_ticks_thresh=100, idle_threshold=30000, rx_buf_size=4000) | |
cmd = rx.receive() | |
tx = machine.RMT(rmt_mode=machine.RMT.TX, channel=0, clk_div=80, pin=machine.Pin(16)) | |
tx.config(loop_en=False) | |
tx.send(list(map(lambda x: ((x[0][0], 1-x[0][1]), (x[1][0], 1-x[1][1])), cmd))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
last_name = 'KONG' | |
first_name = 'Jin Gi' | |
company = 'IBM' | |
ugfx.clear(ugfx.BLACK) | |
ugfx.set_default_font('IBMPlexMono_Bold48') | |
ugfx.text(82, 30, first_name, ugfx.WHITE) | |
ugfx.text(108, 90, last_name, ugfx.WHITE) | |
ugfx.text(121, 150, company, ugfx.BLUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ugfx | |
import machine | |
import network | |
from util import * | |
sta_if = network.WLAN(network.STA_IF) | |
import webrepl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import machine | |
from bh1750 import BH1750 | |
import time | |
scl = machine.Pin(33, machine.Pin.IN) | |
sda = machine.Pin(26, machine.Pin.IN) | |
i2c = machine.I2C(scl,sda) | |
s = BH1750(i2c) |
NewerOlder