Skip to content

Instantly share code, notes, and snippets.

Avatar

Don Park donpdonp

View GitHub Profile
@donpdonp
donpdonp / 911.js
Last active Mar 11, 2020
gluon Portland 911 watch
View 911.js
(function() {
return {name:"911"}
})
var alert_channel = '#pdxbots'
var reports
var reportdate
function go(msg) {
if (msg.method == "clocktower" && (new Date(Date.parse(msg.params.time))).getMinutes() == 15) {
View russelltemp.js
(function() {
return {name: "russelltemp"}
})
function go(msg){
if (msg.method == "irc.privmsg") {
var epoch_match = /^!russelltemp(\s+(\S+))$/.exec(msg.params.message)
if(epoch_match) {
var sensor_id = epoch_match[2]
var rows = russelltemp(sensor_id)
@donpdonp
donpdonp / osm.js
Last active Jun 16, 2020
gluon osm openstreetmap lookups
View osm.js
(function() {
// descriptor
return {name:"osm"}
})
// osm json
//{"bearing":345.9410965462545,"distance":355.0966239302687,
// "node":{"id":1963188104,"lat":45.5233261,"lon":-122.6584695,"tags":{...
function go(msg) {
@donpdonp
donpdonp / shift2bikes.js
Last active Jun 4, 2019
gluon shift2bikes pedalpalooza calendar
View shift2bikes.js
(function() {
return {name:"shift2bikes"}
})
function go(msg) {
if (msg.method == "irc.privmsg") {
var cmd = /^!shift2bikes(\s+(.*))?/.exec(msg.params.message)
if(cmd) {
var now = new Date()
var rides = shiftGet(now)
View gist:29c577985063acb48e69df74e433973f
donp@jewel zig $ git diff
diff --git a/build.zig b/build.zig
index dd8c6fe..3411e9d 100644
--- a/build.zig
+++ b/build.zig
@@ -1,3 +1,4 @@
+const builtin = @import("builtin");
const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
@donpdonp
donpdonp / omdb.js
Last active Sep 18, 2019
gluon omdb/imdb
View omdb.js
(function() {
// setup
setup()
// descriptor
return {name:"omdb"}
})
var api_key
function setup() {
View gist:5369be9d165e4410607567d7aeafe323
donp@jewel zig $ pijul checkout leftover
Current branch: "leftover"
donp@jewel zig $ echo '//extra line' >> build.zig
donp@jewel zig $ pijul status
On branch leftover
Changes not yet recorded:
(use "pijul record ..." to record a new patch)
modified: build.zig
View gist:5ce24b80e4ab781c3b69eb0994a04118
donp@jewel zig $ pjr
What is the name of this patch? leftover change test
Recorded patch 7tFVSqB5XCfBmxrYZHEnN8BfADS4N9FDh9dGoGXhZJ34MnLHHsVzf476R7XrL3U4QidArp6dXPXu2NDvgdC3hTKi
donp@jewel zig $ pijul checkout master
Current branch: "master"
donp@jewel zig $ pijul pull --from-branch leftover
No new patches to pull.
donp@jewel zig $
View union.zig
donp@jewel 1off $ cat main.zig
pub const Command = struct {
id: u16,
payload: union {
a: u16,
b: u16
}
};
pub fn main() void {
@donpdonp
donpdonp / uuid.js
Last active May 1, 2019
gluon uuid
View uuid.js
(function() {
// descriptor
return {name: "uuid"}
})
function go(msg) {
if (msg.method == "irc.privmsg") {
var cmd_match = /^!?uuid/.exec(msg.params.message)
if(cmd_match) {
bot.say(msg.params.channel, uuid())
You can’t perform that action at this time.