Skip to content

Instantly share code, notes, and snippets.

View jrusbatch's full-sized avatar

Justin Rusbatch jrusbatch

View GitHub Profile

EventListener Polyfill

Is IE8 your new IE6? Level the playing field with polyfills.

This script polyfills addEventListener, removeEventListener, and dispatchEvent. It is less than half a kilobyte minified and gzipped.

addEventListener

addEventListener registers a single event listener on a single target.

@jrusbatch
jrusbatch / job.cs
Last active August 29, 2015 14:08 — forked from clairernovotny/job.cs
internal class Job : IDisposable
{
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
static extern IntPtr CreateJobObject(IntPtr a, string lpName);
[DllImport("kernel32.dll")]
static extern bool SetInformationJobObject(IntPtr hJob, JobObjectInfoType infoType, IntPtr lpJobObjectInfo, UInt32 cbJobObjectInfoLength);
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool AssignProcessToJobObject(IntPtr job, IntPtr process);
@jrusbatch
jrusbatch / Job.cs
Created September 28, 2016 17:11 — forked from clairernovotny/Job.cs
Job objects in .NET
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
internal class Job : IDisposable
{