Skip to content

Instantly share code, notes, and snippets.

View david-risney's full-sized avatar
🕴️

David Risney david-risney

🕴️
View GitHub Profile

⚠️ this is now stupidly out of date

Computers

  • 13" Macbook Pro 3.3 GHz i7 (late 2016)
  • Microsoft Surface Book (2016)

Peripherals

@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
This code won't run - just trying to get the idea across of how we might replace registerProtocolHandler, but only if register and registee both agree to use the replacement.
Page that wants to register:
<iframe class="hidden" src="http://you.github.io/registerProtocolHandler/" id="registerProtocolHandler"></iframe>
<script>
document.getElementById("registerProtocolHandler").contentWindow.postMessage({
operation: "setRegistration",
scheme: "web+action",
handler: "http://me.com/?url=%s"
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@DrPizza
DrPizza / gist:3506435
Created August 29, 2012 03:12
Capturing lambdas converted to function pointers.
#include <SDKDDKVer.h>
#include <Windows.h>
#include <memory>
#include <functional>
template<typename R, typename... A>
struct thunk {
thunk(std::function<R(A...)> fn) : the_thunk(new thunk_holder(fn)) {