Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Beduneau enwin

View GitHub Profile
@enwin
enwin / reactive-array-update.js
Created Oct 27, 2019
Update an array of objects while keeping it reactive for vue
View reactive-array-update.js
export default (vueArray, data) => {
data.forEach((entry, index) => {
if (!vueArray[index]) {
vueArray.push(entry);
return;
}
const previousEntry = vueArray[index];
vueArray.splice(index, 1, {
@enwin
enwin / sticky-focus.js
Last active Jun 20, 2018
Detect and change the scroll position when a focused element is under a sticky element
View sticky-focus.js
// sticky element
var stickyHeader = document.querySelector( '.intro-banner' );
function handleFocus( e ){
// don't try to change the scroll if the focused element is in the sticky element
if( stickyHeader.contains( e.target )){
return;
}
// quick & dirty client height on each focus
@enwin
enwin / WSL_and_frond-end.md
Last active Sep 12, 2018
(WIP) Windows / WSL configuration to get a nice front-end setup
View WSL_and_frond-end.md
View keybase.md

Keybase proof

I hereby claim:

  • I am enwin on github.
  • I am enwin (https://keybase.io/enwin) on keybase.
  • I have a public key whose fingerprint is 20BF 28A4 0747 EF59 3C2D 9ECE FFA3 980F 38BD 7A9D

To claim this, I am signing this object:

@enwin
enwin / replace emoji
Last active Aug 29, 2015
Replace Firefox OS emoji font
View replace emoji
first backup you profile!!!
use [https://github.com/Mozilla-TWQA/B2G-flash-tool/blob/master/backup_restore_profile.sh] to do so.
then, create a backup of the default emoji font
```shell
adb pull /system/fonts/NotoColorEmoji.ttf
```
then rename your emoji font to NotoColorEmoji.ttf for convenience and run:
View touches.js
$('a').bind('touchstart touchend touchcancel click',function(e){
// prevent click on touch actions
e.preventDefault();
// stop script if touchstart, only execute the script on touchend (nicer)
e.type === touchstart && return
alert('here');
});