Skip to content

Instantly share code, notes, and snippets.

@rjmcguire
rjmcguire / funcs.js
Created October 8, 2016 20:39 — forked from anonymous/funcs.js
7 js function
debounce = function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
#!/usr/bin/env python2
# Author: Chris Dellin <[email protected]>
# Date: 2016-09-14
# Script to scrape a working OAuth code from Google
# using the approach from dequis [see: https://github.com/tdryer/hangups/issues/260#issuecomment-247234371]
# for use with hangups, purple-hangouts, etc.
import pygtk
pygtk.require('2.0')
@rjmcguire
rjmcguire / README.md
Created September 12, 2016 15:09 — forked from rkirsling/LICENSE
Trend Chart (Area + Line)

This "trend chart" shows loading times across releases of a hypothetical web application.

It is a mixture of a line chart and an area chart, with the daily median loading time indicated by the line and percentile ranges indicated by the surrounding areas.

The "lollipops" mark releases of (different parts of) the application.

@rjmcguire
rjmcguire / README.md
Created September 12, 2016 15:08 — forked from rkirsling/LICENSE
Directed Graph Editor

Click in the open space to add a node, drag from one node to another to add an edge.
Ctrl-drag a node to move the graph layout.
Click a node or an edge to select it.

When a node is selected: R toggles reflexivity, Delete removes the node.
When an edge is selected: L(eft), R(ight), B(oth) change direction, Delete removes the edge.

To see this example as part of a larger project, check out Modal Logic Playground!

@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.
//
// from: http://dpaste.dzfl.pl/50a8a7aa1267
// d references this dpaste:
/*
from: Basile.B via Digitalmars-d <[email protected]>
reply-to: "digitalmars.D" <[email protected]>
to: [email protected]
date: Sat, Nov 28, 2015 at 12:31 AM
subject: Struct multiple inheritance - another solution
mailing list: [email protected] Filter messages from this mailing list
mailed-by: puremagic.com
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
/* -------------------------------------------------------------------------- */
import Dll_ = core.sys.windows.dll;
import W32_ = core.sys.windows.windows;
/* -------------------------------------------------------------------------- */
/* --- runtime initialisation --- */
version (CRuntime_DigitalMars) {} else {static assert(0);};
@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
@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"
)