Skip to content

Instantly share code, notes, and snippets.

View AshishKapoor's full-sized avatar
💭
Here to build.

Ashish Kapoor AshishKapoor

💭
Here to build.
View GitHub Profile
{"contents":{"editor":{"formatOnSave":true}},"overrides":[],"keys":["editor.formatOnSave"]}
@AshishKapoor
AshishKapoor / vscode_shortcuts.md
Created July 11, 2021 12:18 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@AshishKapoor
AshishKapoor / iterm2.md
Created February 23, 2020 21:03 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@AshishKapoor
AshishKapoor / docker-help.md
Created August 19, 2019 19:41 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@AshishKapoor
AshishKapoor / README.md
Created July 8, 2018 12:27 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@AshishKapoor
AshishKapoor / tmux-cheats.md
Created February 26, 2018 06:53 — forked from Starefossen/tmux-cheats.md
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@AshishKapoor
AshishKapoor / timeago.swift
Created July 6, 2017 16:00 — forked from minorbug/timeago.swift
"Time ago" function for Swift (based on MatthewYork's DateTools for Objective-C)
func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String {
let calendar = NSCalendar.currentCalendar()
let unitFlags = NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitHour | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitSecond
let now = NSDate()
let earliest = now.earlierDate(date)
let latest = (earliest == now) ? date : now
let components:NSDateComponents = calendar.components(unitFlags, fromDate: earliest, toDate: latest, options: nil)
if (components.year >= 2) {
return "\(components.year) years ago"