First, install Solaar to see the battery level on the taskbar
sudo apt-get install solaar
To remap the keys, install
sudo apt-get install xbindkeys xautomation
import { readFileSync } from 'fs'; | |
import { resolve } from 'path'; | |
const pkg = JSON.parse( | |
readFileSync(resolve(process.cwd(), 'package.json'), 'utf-8').toString(), | |
); | |
const DATE_FORMAT = 'DD-MM-YYYY-hh:mm:ss.SSS'; | |
const colors = { |
First, install Solaar to see the battery level on the taskbar
sudo apt-get install solaar
To remap the keys, install
sudo apt-get install xbindkeys xautomation
import { remote } from 'electron' | |
remote.globalShortcut.register('CommandOrControl+Shift+K', () => { | |
remote.BrowserWindow.getFocusedWindow().webContents.openDevTools() | |
}) | |
window.addEventListener('beforeunload', () => { | |
remote.globalShortcut.unregisterAll() | |
}) |
export class AppModule { | |
constructor(private router: Router, private viewportScroller: ViewportScroller) { | |
this.handleScrollOnNavigation(); | |
} | |
/** | |
* When route is changed, Angular interprets a simple query params change as "forward navigation" too. | |
* Using the pairwise function allows us to have both the previous and current router events, which we can | |
* use to effectively compare the two navigation events and see if they actually change route, or only | |
* the route parameters (i.e. selections stored in query params). |
// Method 1 | |
var isTouchDevice = | |
(('ontouchstart' in window) || | |
(navigator.MaxTouchPoints > 0) || | |
(navigator.msMaxTouchPoints > 0)); | |
if(!isTouchDevice){ | |
console.log('is not touch'); | |
}else{ | |
console.log('is touch'); | |
} |
// Get binary file using XMLHttpRequest | |
function getBinary(file) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", file, false); | |
xhr.overrideMimeType("text/plain; charset=x-user-defined"); | |
xhr.send(null); | |
return xhr.responseText; | |
} | |
// Base64 encode binary string |
# Add this to the bottom of your config.fish file | |
# Set SSH to use Gnome keyring | |
set -gx SSH_AUTH_SOCK (gnome-keyring-daemon --start | grep "^SSH_AUTH_SOCK" | awk -F "=" '{print $2}') |
import { | |
AfterViewInit, | |
Component, | |
ElementRef, | |
Input, | |
OnDestroy, | |
ViewChild | |
} from '@angular/core'; | |
import { fromEvent } from 'rxjs'; | |
import { pairwise, switchMap, takeUntil } from 'rxjs/operators'; |
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |