Skip to content

Instantly share code, notes, and snippets.

Avatar

Don Park donpdonp

View GitHub Profile
View gist:d770da8dde3aaba0e6a25f5d35c78856
diff --git a/src/main.zig b/src/main.zig
index d651eb9..93bb0ea 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -230,7 +230,7 @@ fn netback(command: *thread.Command) void {
for(tree.root.Array.toSlice()) |jsonValue| {
const item = jsonValue.Object;
var toot = allocator.create(toot_lib.Type) catch unreachable;
- toot.init(item, allocator);
+ toot = toot_lib.Type.init(item, allocator);
View gist:b6d51d70c4b59c3780d760f8b0938685
/* gdk/gdkevents.h */
struct _GdkEventTouch
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
gdouble x;
gdouble y;
gdouble *axes;
View gist:c615aa58ff8f408410daf4477de80b1f
/* https://github.com/cirosantilli/x86-bare-metal-examples#bios-hello-world */
#include "common.h"
BEGIN
DBG
mov $msg, %si
mov $0x0e, %ah
loop:
lodsb
or %al, %al
@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
You can’t perform that action at this time.