Skip to content

Instantly share code, notes, and snippets.

View caina-jumia's full-sized avatar
👽

Cainã Brazil caina-jumia

👽
View GitHub Profile
@caina-jumia
caina-jumia / passive_check.js
Created February 1, 2019 11:44
Check if browser has support for feature passively
var optionsSupport = 'nha';
try {
window.scroll({
get top () {
optionsSupport = true;
},
});
} catch (e) {
optionsSupport = false;
const queryString = Array.from(new FormData(formElement), e => e.map(encodeURIComponent).join('=')).join('&')
@caina-jumia
caina-jumia / cloudSettings
Last active January 28, 2019 10:32
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-01-28T10:32:33.732Z","extensionVersion":"v3.2.4"}
#!/bin/bash
read TPdevice <<< $( xinput | sed -nre '/TouchPad/s/.*id=([0-9]*).*/\1/p' )
state=$( xinput list-props "$TPdevice" | grep "Device Enabled" | grep -o "[01]$" )
if [ "$state" -eq '1' ];then
xinput --disable "$TPdevice" && notify-send -i emblem-nowrite "Touchpad" "Disabled"
else
xinput --enable "$TPdevice" && notify-send -i input-touchpad "Touchpad" "Enabled"
fi