Skip to content

Instantly share code, notes, and snippets.

@tonytangau
tonytangau / settings.json
Last active September 3, 2021 02:25
VS code Workspace setting to hide/collapse typescript generated files
{
"files.exclude": {
"**/*.js": { "when": "$(basename).ts" },
"**/**.js": { "when": "$(basename).tsx" },
"**/*.d.ts": { "when": "$(basename).ts" },
"**/**.map": true,
}
}
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
ports:
- port: 8000
targetPort: 80
protocol: TCP
selector:
# Add "touch" to powershell
# > code $profile
function touch {
Param(
[Parameter(Mandatory=$true)]
[string]$Path
)
if (Test-Path -LiteralPath $Path) {
# IDE files
.idea
# Logs
logs
*.log
# Runtime data
pids
*.pid
export ZSH='/Users/tony_tang/.oh-my-zsh'
POWERLEVEL9K_MODE='awesome-patched'
ZSH_THEME="powerlevel9k/powerlevel9k"
plugins=(
git
)
source $ZSH/oh-my-zsh.sh
@tonytangau
tonytangau / iosFixedElement.js
Last active May 9, 2017 03:40
Fixed elements (eg. navigation menu, modal dialog) in ios that prevents background scrolling.
// "fixed-element" is the class of the overlay (fixed element) what has "position: fixed"
// Call disableScroll() and enableScroll() to toggle
var freeze = function(e) {
if (!document.getElementsByClassName("fixed-element")[0].contains(e.target)) {
e.preventDefault();
}
}
var disableScroll = function() {