Skip to content

Instantly share code, notes, and snippets.

View Killavus's full-sized avatar

Marcin Grzywaczewski Killavus

  • Wrocław, Poland
View GitHub Profile
1 runs average:
{
"Vue": 760.9619999420829,
"Backbone": 690.1490000891499,
"Knockout": 558.2629999844357,
"Ember": 1981.3939999730792,
"Angular": 816.4939999987837,
"React": 1021.7939999711234,
"Om": 812.5769999751355,
"Om v": 880.1849999581464,
ui: (isLoaded) ->
{
true: @mappingsList
false: @spinner
}[isLoaded]()
for searchCriteriaIndex in Config.SearchCriteria
((_searchCriteriaIndex) -> that._roomOptionTestCase(_url, _searchCriteriaIndex))(searchCriteriaIndex)
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>
int main(void) {
pid_t cpid = fork();
if(cpid == 0) {
exit(0);
}
else
class DomainModel
constructor: (@id, @name, ... rest of arguments) ->
@fromJSON: (json) ->
new DomainModel(json.id, json.name, ... rest of arguments)
# put your domain logic here.
module.exports = DomainModel
class EventStream
constructor: (@options = {}, @stream = undefined) ->
unless @stream?
streamType = EventStream.subjectType(@options.repeating)
@stream = new streamType()
publish: (eventName, args...) =>
@stream.onNext.call(@stream, [eventName].concat(args))
on: (eventName, callback) =>
mapper = Lotus::Model::Mapper.new do
# ...
end
module Foo
class Bar < Lotus::Application
configure do
# ...
mapping(mapper)
# ...
import React from 'react/addons';
import { InvitedPerson, InvitationList } from 'components/InvitationList';
describe("Invitation List - testing with shallow rendering", () => {
beforeEach(function() {
this.examplePeople = [
{ id: 1, name: "Waldo" },
{ id: 2, name: "Hercules" }
];
import React from 'react/addons';
import { DragDropContext, DragSource } from 'react-dnd';
import HTML5Backend from 'react-dnd/modules/backends/HTML5';
@DragDropContext(HTML5Backend)
class App extends React.Component {
render() {
return(
<div>
@Killavus
Killavus / emptyFnLeverageExample.js
Created September 20, 2015 20:49
Processing graph-data. Each of node has a type. I leverage this knowledge to not 'ask', but tell what I want to do.
function emptyFn() {}
function matchNode(node, typeFunctions) {
return (typeFunctions[node.type] || emptyFn)(node);
}
// Example usage:
neighbourList.forEach(function(node) {
result = result.concat(