Skip to content

Instantly share code, notes, and snippets.

View LopatkinEvgeniy's full-sized avatar

Евгений LopatkinEvgeniy

View GitHub Profile
@jhurliman
jhurliman / mutex.js
Created July 14, 2012 21:17 — forked from elarkin/Mutex.js
A simple mutex library for node.js
var EventEmitter = require('events').EventEmitter;
module.exports = function() {
var queue = new EventEmitter();
var locked = false;
this.lock = function lock(fn) {
if (locked) {
queue.once('ready', function() { lock(fn); });
} else {
@joaoneto
joaoneto / login.test.js
Created March 13, 2013 13:49
Login session test with mocha
var request = require('supertest'),
should = require('should'),
app = require('../server');
var Cookies;
describe('Functional Test <Sessions>:', function () {
it('should create user session for valid user', function (done) {
request(app)
.post('/v1/sessions')
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@ForNeVeR
ForNeVeR / main.cpp
Created February 14, 2014 14:32
"ЩИ!!!Симулятор жестокости" - http://www.gamedev.ru/projects/forum/?id=160897
#define WIN32_LEAN_AND_MEAN // just say no to MFC
#define INIT_GUID
#include "hge.h"
#include <hgesprite.h>
#include <hgefont.h>
#include <hgecolor.h>