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
span(data-bind='reactElement: someElement') |
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
// Type definitions for RouteRecognizer 0.1.4 | |
// Project: https://github.com/tildeio/route-recognizer | |
declare class RouteRecognizer { | |
add(routes: Object[], options?: Object): void; | |
map(callback: RouteRecognizer.Callback): void; | |
recognize(path: string): RouteRecognizer.Result; | |
} | |
declare module RouteRecognizer { |
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
module something { | |
// inspired by https://github.com/acdlite/flummox/blob/master/docs/api/FluxComponent.md | |
/* example usage | |
class SimpleContainer extends FluxSimpleContainer { | |
stores = { | |
userStore: App.userStore, | |
} | |
getState = () => ({ | |
users: this.stores.userStore.getUsers(), |
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
case <<"first middle last">> of | |
<<"first", Bin/binary>> | |
when binary_part(Bin, {byte_size(Bin), -4}) =:= <<"last">> -> | |
ok | |
end. |
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
#!/bin/bash | |
cd -- "${0%/*}" | |
CHECK_SEC=60 | |
INACTIVE_SEC=600 | |
DIRECTORY="sameroom" | |
TIMEOUT_TMP_FILE="./timeout" | |
DOCKER_NAME="sameroom-dev" |
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
constructor(dispatcher) { | |
super(dispatcher, () => ({ | |
greetings: 123, | |
newGreeting: 123 | |
})); | |
} |
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
const onDispatch = (action: Event) => { | |
switch(action.type) { | |
case GreetingActionTypes.ADD_GREETING: | |
let payload1 = (<AddGreetingEvent> action).payload; | |
this._state.newGreeting = ''; | |
this._state.greetings = this._state.greetings.concat(payload1); | |
this.emitChange(); | |
break; | |
case GreetingActionTypes.REMOVE_GREETING: | |
let payload2 = (<RemoveGreeting> action).payload; |
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
const onDispatch = (action: Event) => { | |
if (action instanceof AddGreetingEvent) { | |
const {payload} = action; | |
this._state.newGreeting = ''; | |
this._state.greetings = this._state.greetings.concat(payload); | |
this.emitChange(); | |
} else if (action instanceof RemoveGreeting) { | |
const {payload} = action; | |
this._state.greetings = this._state.greetings.filter(g => g !== payload); | |
this.emitChange(); |
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
const StatusIcon = () => { | |
const color1 = "green"; | |
const color2 = "#74ba74"; | |
const color3 = "#74ba74"; | |
const radius = 50; | |
return <div id="status_icon"><style>{` | |
#status_icon{ | |
width: ${radius}px; | |
height: ${radius}px; | |
border-radius: ${radius}px; |
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
constructor(dispatcher) { | |
super(dispatcher, () => ({ | |
greetings: [], | |
newGreeting: '' | |
})); | |
} |