Skip to content

Instantly share code, notes, and snippets.

@vicioux
vicioux / RepeatingTimer.swift
Created August 6, 2020 19:10 — forked from danielgalasko/RepeatingTimer.swift
A repeating GCD timer that can run on a background queue
/// RepeatingTimer mimics the API of DispatchSourceTimer but in a way that prevents
/// crashes that occur from calling resume multiple times on a timer that is
/// already resumed (noted by https://github.com/SiftScience/sift-ios/issues/52
class RepeatingTimer {
let timeInterval: TimeInterval
init(timeInterval: TimeInterval) {
self.timeInterval = timeInterval
}
@vicioux
vicioux / http-error.js
Created November 16, 2018 14:23 — forked from TooTallNate/http-error.js
HTTPError class for JavaScript HTTP errors
import { format } from 'url';
import { STATUS_CODES } from 'http';
import uppercamelcase from 'uppercamelcase';
class HTTPError extends Error {
constructor(code, message, extras) {
super(message || STATUS_CODES[code]);
if (arguments.length >= 3 && extras) {
Object.assign(this, extras);
}
### Keybase proof
I hereby claim:
* I am vicioux on github.
* I am vicioux (https://keybase.io/vicioux) on keybase.
* I have a public key ASCPxxhxPmbHGbvRCYdPFAi5BHI7czuYacDzp4lkTtnIpAo
To claim this, I am signing this object:
@vicioux
vicioux / ember_examples.md
Created November 24, 2015 19:56 — forked from rwjblue/ember_examples.md
Ember Examples