This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { providers } from 'ethers'; | |
const EXPECTED_PONG_BACK = 15000; | |
const KEEP_ALIVE_CHECK_INTERVAL = 7500; | |
// Used to "trick" TypeScript into treating a Proxy as the intended proxied class | |
export const fakeBaseClass = <T>() : new() => Pick<T, keyof T> => (class {} as any); | |
export class ReconnectingWebSocketProvider extends fakeBaseClass<providers.WebSocketProvider>() { | |
private underlyingProvider: providers.WebSocketProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec::Matchers.define :have_attr_accessor do |field| | |
match do |klass| | |
klass.respond_to?(field) && klass.respond_to?("#{field}=") | |
end | |
failure_message do |klass| | |
"expected attr_accessor for #{field} on #{klass}" | |
end | |
failure_message_when_negated do |klass| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'opencv' | |
include OpenCV | |
FPS = 30 | |
input = CvCapture.open | |
win = GUI::Window.new 'video' | |
loop do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function monitorEvents(element) { | |
var log = function(e) { console.log(e);}; | |
var events = []; | |
for(var i in element) { | |
if(i.startsWith("on")) events.push(i.substr(2)); | |
} | |
events.forEach(function(eventName) { | |
element.addEventListener(eventName, log); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker stop $(docker ps -a -q) | |
docker rm $(docker ps -a -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"apps": [{ | |
"name": "Application", | |
"exec_interpreter": "./node_modules/babel-cli/bin/babel-node.js", | |
"script": "./bin/www", | |
"args": [], | |
"watch": ["public", "package.json", "pm2.development.json"], | |
"ignore_watch": ["public"], | |
"watch_options": { | |
"persistent": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Ahmad Karimpour <[email protected]> | |
* | |
* Created_at 2012 | |
* | |
* Class Enum | |
*/ | |
class Enum |