Skip to content

Instantly share code, notes, and snippets.

@dotandimet
dotandimet / 0_reuse_code.js
Created June 23, 2014 16:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am dotandimet on github.
  • I am dotandimet (https://keybase.io/dotandimet) on keybase.
  • I have a public key ASBvXbQcpCZJxHo87NkK0JKL76iohNUcYprHfDz_k-tt4Qo

To claim this, I am signing this object:

from unittest.mock import Mock, patch
import mypackage
import other
def test():
thing = mypackage.get_my_class()
thing.method = Mock()
with patch('other.get_my_class',
@dotandimet
dotandimet / event-fun.js
Created March 2, 2021 15:16
An Observable object that emits change events
const EventEmitter = require('events');
class Observable extends EventEmitter {
constructor(source) {
super();
this.self = {};