To check what the real type of and variable, run this command:
Object.prototype.toString.call(myVar)
It'll return something like [object Object]
. The second word is the real type of the variable.
Some examples:
#!/bin/bash | |
echo 'Removing origins...' | |
git remote prune origin | |
BRANCHES=`git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}'` | |
if [[ `echo -e "$BRANCHES" | wc -w` -gt 0 ]]; then | |
echo 'Removing branches:' | |
echo $BRANCHES |
To check what the real type of and variable, run this command:
Object.prototype.toString.call(myVar)
It'll return something like [object Object]
. The second word is the real type of the variable.
Some examples:
# Salvar num arquivo ~/encode.sh, conceder direito de execução e | |
# executar desta forma (adaptar nomes de diretórios e arquivos para seu caso): | |
# $ ~/encode.sh ~/Video/bigFile.mp4 ~/Video/smallFile.mp4 | |
ffmpeg -i "$1" -vcodec h264 -acodec aac "$2" |
Setting up hybrid graphics linux is generally painful with the current state of Nvidia support. If you can avoid getting an Nvidia GPU based laptop if you plan to use Linux. I use a distro called Archcraft and had some issues specific to my setup (distro/hardware)
The hardware I am installing this on is a TongFang GM6TG7W (aka Wootbook Extreme IV). It has an Intel iGPU and an Nvidia 3070 Max-Q dGPU.
import { DebouncedFunc } from "lodash" | |
import debounce from "lodash.debounce" | |
import { useMemo } from "react" | |
export default function useDebouncedFn<T extends (...args: any[]) => void>(fn: T, wait?: number) { | |
return useMemo(() =>( | |
debounce((...args:any[]) => {fn(...args)}, wait ?? 300) as DebouncedFunc<T> | |
), [fn, wait]) | |
} |
const username = "USER_NAME_HERE"; | |
/** | |
* Initialized like this so we can still run it from browsers, but also use typescript on a code editor for intellisense. | |
*/ | |
let followers = [{ username: "", full_name: "" }]; | |
let followings = [{ username: "", full_name: "" }]; | |
let dontFollowMeBack = [{ username: "", full_name: "" }]; | |
let iDontFollowBack = [{ username: "", full_name: "" }]; |
tags: linux, gnome, networkManager, pkcs12, p12
reference: askubuntu
This article intends to be reference when importing a openvpn file to NetworkManager on linux
.ovpn
file with the following command:[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory = $true, Position = 0)][string]$exeFileName, | |
[Parameter(Mandatory = $true, Position = 1)][string]$credentialName | |
) | |
$wshell = New-Object -ComObject Wscript.Shell -ErrorAction Stop | |
function CheckIfFileExists { |
function useMedia(query) { | |
const [matches, setMatches] = useState(window.matchMedia(query).matches) | |
useEffect(() => { | |
const media = window.matchMedia(query) | |
if (media.matches !== matches) { | |
setMatches(media.matches) | |
} | |
const listener = () => { | |
setMatches(media.matches) |