Skip to content

Instantly share code, notes, and snippets.

@rjmcguire
rjmcguire / opengl-transparency-demo.cpp
Created September 25, 2015 21:31 — forked from wilkie/opengl-transparency-demo.cpp
Rendering directly to a composited window in vista+ with opengl.
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <windowsx.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <dwmapi.h>
#pragma comment (lib, "opengl32.lib")
@rjmcguire
rjmcguire / connectHTMLelements_SVG.png
Created July 10, 2016 06:36 — forked from alojzije/connectHTMLelements_SVG.png
Connect two elements / draw a path between two elements with SVG path (using jQuery)
connectHTMLelements_SVG.png
https://github.com/darylrowland/react-native-remote-push
https://facebook.github.io/react-native/docs/pushnotificationios.html
Pubnub can also do realtime chat, but it's a relatively expensive service.
The node.js server can be augmented with socket.io and function as a real-time chat server.
Amazon SNS https://aws.amazon.com/sns/
https://aws.amazon.com/sns/pricing/ (faily cheap and works for all platforms, plus we'd get tech support at the loft)
@rjmcguire
rjmcguire / GoMgoSample-1.go
Created August 4, 2016 13:58 — forked from ardan-bkennedy/GoMgoSample-1.go
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
@rjmcguire
rjmcguire / ssl_smtp_example.go
Created August 5, 2016 09:47 — forked from chrisgillis/ssl_smtp_example.go
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@rjmcguire
rjmcguire / gcstub.d
Created September 1, 2016 16:25 — forked from Cauterite/gcstub.d
dmd-frontend GC
/**
* This module contains a minimal garbage collector implementation according to
* published requirements. This library is mostly intended to serve as an
* example, but it is usable in applications which do not rely on a garbage
* collector to clean up memory (ie. when dynamic array resizing is not used,
* and all memory allocated with 'new' is freed deterministically with
* 'delete').
*
* Please note that block attribute data must be tracked, or at a minimum, the
* FINALIZE bit must be tracked for any allocated memory block because calling
/* -------------------------------------------------------------------------- */
import Dll_ = core.sys.windows.dll;
import W32_ = core.sys.windows.windows;
/* -------------------------------------------------------------------------- */
/* --- runtime initialisation --- */
version (CRuntime_DigitalMars) {} else {static assert(0);};
line = "dumped hex values"
s=""
n = 8
for w in [line[i:i+n] for i in range(0, len(line), n)]:
c = [w[i:i+2] for i in range(0, len(w), 2)]
c.reverse() # endian foo
for a in c:
s+=chr(int(a,16))
print s
@rjmcguire
rjmcguire / main.m
Created September 3, 2016 22:34 — forked from stuartcarnie/main.m
Demonstrates we can now support limited JIT compilation on recent versions of iOS (assuming Apple approves entitlements at some future point)
//
// main.m
// ProtectTest
// Demonstrates newer versions of iOS now support PROT_EXEC pages, for just-in-time compilation.
//
// Must be compiled with Thumb disabled
//
// Created by Stuart Carnie on 3/4/11.
// Copyright 2011 Manomio LLC. All rights reserved.
//