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
" a better htmldjango detection | |
augroup filetypedetect | |
" removes current htmldjango detection located at $VIMRUNTIME/filetype.vim | |
au! BufNewFile,BufRead *.html | |
au BufNewFile,BufRead *.html call FThtml() | |
func! FThtml() | |
let n = 1 | |
while n < 10 && n < line("$") | |
if getline(n) =~ '\<DTD\s\+XHTML\s' |
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
// inside your beforeEach hook | |
spyOn(window, 'setTimeout').andCallFake(function(fn){ | |
fn.apply(null, [].slice.call(arguments, 2)); | |
return +new Date; | |
}); | |
... |
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
/* | |
Copyright (c) 2009 Rob Bast | |
Permission is hereby granted, free of charge, to any person | |
obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without | |
restriction, including without limitation the rights to use, | |
copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software |
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
/* | |
--- | |
Port from the YUI3 event-simulate functionality to vanilla javascript. | |
... | |
*/ | |
(function(global, document){ | |
var mix = function(obj1, obj2){ | |
for (var key in obj2){ | |
obj1[key] = obj2[key]; |
NewerOlder