Skip to content

Instantly share code, notes, and snippets.

View blainsmith's full-sized avatar
☠️

Blain Smith blainsmith

☠️
View GitHub Profile
@blainsmith
blainsmith / udp.ha
Created May 9, 2022 16:12
UDP Server in Hare
use fmt;
use net::udp;
use net::ip;
use strings;
export fn main() void = {
const listener = udp::listen(ip::LOCAL_V4, 8000)!;
for (true) {
let buf: [1024]u8 = [0...];
@blainsmith
blainsmith / jwplatformclient.go
Last active July 18, 2019 20:25
JWPlatform REST API Client example
package ovp
import (
"context"
"crypto/md5"
"fmt"
"net/http"
"net/url"
"strconv"
"time"
@blainsmith
blainsmith / pub.c
Last active April 4, 2018 18:06
Go and C Redis Pub/Sub
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <hiredis/hiredis.h>
int main(int argc, char **argv) {
unsigned int j;
@blainsmith
blainsmith / redis-copy.sh
Created June 3, 2017 00:56
Copy keys from one Redis instance to another
# Set variables accordingly
source_host=ecfoo.amazonaws.com
source_password=foo
source_port=6666
source_db=0
target_host=ecbar.amazonaws.com
target_password=bar
target_port=6777
target_db=0

Keybase proof

I hereby claim:

  • I am blainsmith on github.
  • I am blainsmith (https://keybase.io/blainsmith) on keybase.
  • I have a public key whose fingerprint is AE3A 28D6 A9A4 DD3B CC3D B3CC B897 8178 1EA8 681A

To claim this, I am signing this object:

@blainsmith
blainsmith / interfaces.go
Last active December 12, 2016 15:28
Interface Exmaple
package main
type Dog interface {
Bark() string
Eat(string)
}
type Bulldog struct {
Name string
}
@blainsmith
blainsmith / Book.json
Created February 19, 2015 18:33
LoopBack ACL with $owner
{
"name": "Book",
"base": "PersistedModel",
"idInjection": true,
"properties": {
"title": {
"type": "string",
"required": true
},
"value": {
@blainsmith
blainsmith / dabblet.css
Created January 14, 2015 13:26
CSS Gridlines
/**
* CSS Gridlines
*/
body {
background-color: #000;
}
ul {
margin: 0 auto;
@blainsmith
blainsmith / js-lib-template.js
Last active February 11, 2024 22:51
JavaScript Library Template
(function() {
// This is a template to begin creating a JS libray. Just replace all instances
// of `lib` with whatever variable you want to use for reference.
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `exports` on the server.
var root = this;

Keybase proof

I hereby claim:

  • I am blainsmith on github.
  • I am blainsmith (https://keybase.io/blainsmith) on keybase.
  • I have a public key whose fingerprint is 4100 89EC 0CC5 925C 07CC 6155 9262 E69F 775D F530

To claim this, I am signing this object: