Function | Shortcut |
---|---|
Fullscreen | ⌘ + Enter |
Previous Tab | ⌘ + Left Arrow |
Next Tab | ⌘ + Right Arrow |
Go to Tab | ⌘ + Number |
Go to Window | ⌘ + Option + Number |
Go to Split Pane by Direction | ⌘ + Option + Arrow |
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
# LINKED | |
txtblk='[\e[0;30m]' # Black | |
txtred='\[\e[0;31m\]' # Red | |
txtgrn='\[\e[0;32m\]' # Green | |
txtylw='\[\e[0;33m\]' # Yellow | |
txtblu='\[\e[0;34m\]' # Blue | |
txtpur='\[\e[0;35m\]' # Purple | |
txtcyn='\[\e[0;36m\]' # Cyan | |
txtwht='\[\e[0;37m\]' # White |
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
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi | |
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" | |
# color vars | |
eval gray='$FG[237]' | |
eval orange='$FG[214]' | |
eval yellow='$fg[yellow]' | |
eval red='$fg[red]' | |
eval cyan='$fg[cyan]' | |
eval magenta='$fg[magenta]' |
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
type IFixMe = any; | |
type IToDo = any; | |
type IInexpressible = any; | |
type INotWorthIt = any; | |
type IFuckIt = any; | |
// When the library you are consuming is fucked up | |
type IBadTypings = any; | |
type IAnyFields = { [field: string]: any }; | |
type IWithAnyFields<T> = T & IAnyFields; |
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
#!/usr/bin/env bash | |
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error | |
# Make sure that the .gnupg directory and its contents is accessibile by your user. | |
chown -R $(whoami) ~/.gnupg/ | |
# Also correct the permissions and access rights on the directory | |
chmod 600 ~/.gnupg/* | |
chmod 700 ~/.gnupg |
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 { useState, useEffect } from "react"; | |
import { NativeModules, StatusBarIOS, Platform, StatusBar } from "react-native"; | |
import get from "lodash/get"; | |
const { StatusBarManager } = NativeModules; | |
export default function useStatusBarHeight() { | |
// Initialize w/ currentHeight b/c StatusBar.currentHeight works properly on android on Android | |
const [height, setHeight] = useState(StatusBar.currentHeight || 0); |
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
interface RecursiveArray<T> extends Array<T | RecursiveArray<T>> {} | |
function getLast<O extends object, K extends keyof O>( | |
mapOrList: O | RecursiveArray<O>, | |
key: K | |
): O[K] | null { | |
if (!mapOrList) return null; | |
if (Array.isArray(mapOrList)) { | |
return getLast(mapOrList.reverse().find(m => !!getLast(m, key))!, 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
import { useState, useEffect, RefObject } from "react"; | |
export default function useAttentionWithin(ref: RefObject<HTMLElement>) { | |
const [attentionWithin, setAttentionWithin] = useState(false); | |
function handleAttentionLeave({ target }: Event) { | |
const targetIsWithin = !!( | |
ref.current && ref.current.contains(target as Node) | |
); |
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
- Installing Homebrew is effortless, open Terminal and enter :
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
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
defmodule TimeConvert do | |
@minute 60 | |
@hour @minute*60 | |
@day @hour*24 | |
@week @day*7 | |
@divisor [@week, @day, @hour, @minute, 1] | |
def to_str(time) do | |
to_str(time, :ms) | |
end |
NewerOlder