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
import { debounce as _debounce, throttle as _throttle } from '@ember/runloop'; | |
function timingDecorator(fn) { | |
return function (delay) { | |
return function (instance, property, descriptor) { | |
return { | |
value(...args) { | |
if (!instance.isDestroying && !instance.isDestroyed) { | |
return fn(instance, descriptor.value, ...args, delay); | |
} |
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
git config --global diff.tool bbdiff | |
git config --global difftool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"' | |
git config --global difftool.prompt false | |
git config --global merge.tool bbdiff | |
git config --global mergetool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"' | |
Double check ~/.gitconfig |
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
// when T is any|unknown, Y is returned, otherwise N | |
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N; | |
// when T is never, Y is returned, otherwise N | |
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N; | |
// when T is a tuple, Y is returned, otherwise N | |
// valid tuples = [string], [string, boolean], | |
// invalid tuples = [], string[], (string | number)[] |
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
/// | |
/// Line-Clamp | |
/// | |
/// https://medium.com/@elad/trimming-multi-lines-in-css-5ae59d5e6d84 | |
/// | |
@mixin line-clamp($lines: null) { | |
@if $lines != null { | |
display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */ | |
-webkit-line-clamp: $lines; |
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
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<!-- Launch Daemon do not always have access to all the path variables | |
As a results, scripts will sometimes fail if the you are using path variables inside them | |
To enable the script to have access to all path variables, open up a terminal and type in --> | |
<!-- echo $PATH --> | |
<!-- You can opt to filter out some of the path variables which are not required by script--> | |
<key>EnvironmentVariables</key> |
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
#Gets screen capture of device every 270 seconds and outputs screencap to timestamped png file in local directory | |
while true; do adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ScreenCap.`date +%Y`.`date +%m`.`date +%d`-`date +%H`.`date +%M`.`date +%S`.png; sleep 270; done | |
#Gets logs from device and outputs them to a timestamped file in local directory | |
while true; do adb logcat -v time > logging`date +%Y`.`date +%m`.`date +%d`-`date +%H`.`date +%M`.`date +%S`.txt; done | |
#Gets PID of <packagename> | |
adb shell ps | grep <packagename> | |
#Outputs battery level to console |
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
#!/bin/bash -eu | |
# | |
# Config. | |
# | |
# Arg 1: file to install on the Android OTT STB, which must be connected, and | |
# mounted read/write as root. See connect-remount-as-root.sh | |
apkpath=${1:-''} |
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
# GIT heart FZF | |
# ------------- | |
is_in_git_repo() { | |
git rev-parse HEAD > /dev/null 2>&1 | |
} | |
fzf-down() { | |
fzf --height 50% "$@" --border | |
} |