Skip to content

Instantly share code, notes, and snippets.

View marocchino's full-sized avatar
🏠
Working from home (7am~16pm JST)

marocchino

🏠
Working from home (7am~16pm JST)
View GitHub Profile

https://github.com/reireias/dotseeker

grep -r -E -v -h '^\s*#' files | grep --color=none -E "^\s*alias " | sed -e 's/#.*//g' -e 's/^\s*//g' -e 's/\s*$//g' | sort | uniq -c | sort -nr
 90 alias ls='ls --color=auto'
 87 alias grep='grep --color=auto'
 59 alias fgrep='fgrep --color=auto'

59 alias egrep='egrep --color=auto'

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
@redism
redism / kr_won_to_backquote.sh
Created April 26, 2017 16:20
macOS Sierra에서 원화(₩) 대신 백 쿼트(`) 입력하기
#!/bin/bash
if [ -f ~/Library/KeyBindings/DefaultkeyBinding.dict ]; then
echo "~/Library/KeyBindings/DefaultkeyBinding.dict already exists"
exit -1
fi
mkdir -p ~/Library/KeyBindings
cat << EOF > ~/Library/KeyBindings/DefaultkeyBinding.dict
{
"₩" = ("insertText:", "\`");
@maxim
maxim / ecto_batch_stream.ex
Last active September 9, 2022 18:15
Similar to Rails `find_each`, but for Elixir's Ecto, using Stream
defmodule EctoBatchStream do
import Ecto.Query, only: [from: 1, from: 2]
@batch_size 1000
# Example:
#
# query = from u in MyApp.User, select: u.email
# stream = EctoBatchStream.stream(MyApp.Repo, query)
# stream |> Stream.take(3) |> Enum.to_list # => […]
@nacyot
nacyot / 2013-03-04-ruby-trivias-you-should-know-4.md
Last active April 17, 2024 05:01
알아두면 도움이 되는 55가지 루비 기법