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 App: () => React$Node = (props) => { | |
const [ players, setPlayers ] = useState([]); | |
useEffect(() => { | |
AsyncStorage.getItem('@maddness_user').then((userData) => { | |
getNearbyPlayers().then(performStompConnect); | |
} | |
}); | |
}, []); |
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
/* Polyfill service v3.27.1 | |
* For detailed credits and licence information see https://github.com/financial-times/polyfill-service. | |
* | |
* Features requested: IntersectionObserver,IntersectionObserverEntry,default | |
* | |
* - IntersectionObserver, License: CC0 */ | |
(function(undefined) { | |
// IntersectionObserver |
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
# Mixed css-in-js solution | |
Current css-in-js solutions generaly have 2 different approaches to inserting styles on the page: | |
1. `style` DOM nodes that have their text `innerHTML` changed | |
2. static style extration, where a CSS file is created from the inlined JS | |
`1` is good because it allows applications to support dynamic styles that have their value changed overtime, but they | |
require a runtime that adds some overhead to the APP and will require the browser to parse the JS code that contains the CSS rules and then the inject CSS. | |
`2` is good because it allows developers to ship CSS directly to the browser, without the runtime cost. |
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
[ignore] | |
.*/node_modules/immutable/.* |
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 x() { | |
if (foo) { | |
return foo; | |
} | |
if (bar) { | |
retur bar; | |
} | |
return baz; | |
} |
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 elementWithRef = shallow(<Component/>).find('<the-ref-element>'); | |
elementWithRef.prop('ref')({ getBoundingClientRect: () => ({ width: 12, ... })}); | |
// do things that would use the ref you just set |
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
# Your keymap | |
# | |
# Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors | |
# to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# | |
# Here's an example taken from Atom's built-in keymap: |
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
/*!{id:msgpack.js,ver:1.05,license:"MIT",author:"[email protected]"}*/ | |
// === msgpack === | |
// MessagePack -> http://msgpack.sourceforge.net/ | |
this.msgpack || (function(globalScope) { | |
globalScope.msgpack = { | |
pack: msgpackpack, // msgpack.pack(data:Mix, | |
// toString:Boolean = false):ByteArray/ByteString/false |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); |
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 Robot(robot) {} | |
Robot.status = 0; | |
Robot.enemy = {}; | |
Robot.enemy.posX; | |
Robot.enemy.posY; | |
Robot.enemy | |
// well, we need to do something... | |
// whenever our robot is idle, this method gets called. | |
Robot.prototype.onIdle = function(ev) { |
NewerOlder