Skip to content

Instantly share code, notes, and snippets.

View hanbyul-here's full-sized avatar

Hanbyul Jo hanbyul-here

  • New York, United States
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
  • deleting all Feature from vue component, but keeps .vue extension.
suffix="Feature.vue"; for file in `find . -name *Feature.vue` ; do git mv "$file" "${file%$suffix}.vue"; done
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
A; B    # Run A and then B, regardless of success of A
A && B  # Run B if and only if A succeeded
A || B  # Run B if and only if A failed
A &     # Run A in background.

For example, this will delete all branches that have not received any commits for a week:

for k in $(git branch | sed /\*/d); do 
  if [ -n "$(git log -1 --since='1 week ago' -s $k)" ]; then
    git branch -D $k
  fi
done

If you want to delete all branches that are more than a week old, use --before:

- https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/
- how to crop: ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4
(when x, y is omitted, crop anchors center)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.