Skip to content

Instantly share code, notes, and snippets.

View oboje's full-sized avatar
🎯
Focusing

Igor Popov oboje

🎯
Focusing
  • New York
View GitHub Profile
@oboje
oboje / convert.sh
Last active September 1, 2017 19:38
converting flac to mp3
#!/bin/bash
# bootstrap: brew install lame flac
for f in *.flac; do
[[ "$f" != *.flac ]] && continue
album="$(metaflac --show-tag=album "$f" | sed 's/[^=]*=//')"
artist="$(metaflac --show-tag=artist "$f" | sed 's/[^=]*=//')"
date="$(metaflac --show-tag=date "$f" | sed 's/[^=]*=//')"
public extension FloatingPoint {
/// Re-maps a number from one range to another.
///
/// - Parameters:
/// - source: The range to interpret the number as being a part of.
/// - destination: The range to map the number to.
/// - clamped: Whether the result should be clamped to the `to` range. Defaults to `false`.
/// - reversed: whether the output mapping should be revserd, such that
/// as the input increases, the output decreases. Defaults to `false`.
@oboje
oboje / keybindings.json
Created September 17, 2017 11:25
keybindings.json
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+t",
"command": "openInTerminal.openIntegrated"
},
{
"key": "shift+cmd+t",
"command": "openInTerminal.openRootIntegrated"
},
@oboje
oboje / cloudSettings
Last active April 14, 2020 13:58
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-04-14T13:58:45.149Z","extensionVersion":"v3.4.3"}
@oboje
oboje / Untitled-1
Created October 7, 2017 19:53
ios links
https://www.raizlabs.com/dev/2014/02/animating-items-in-a-uicollectionview/
@oboje
oboje / rubynotes.sh
Created October 22, 2017 15:37
rubynotes.sh
#swagger ruby fix
grep -rl "ActiveRecord::Migration$" db | xargs sed -i "" "s/ActiveRecord::Migration/ActiveRecord::Migration[5.1]/g"
@oboje
oboje / sorting.hs
Created November 29, 2017 14:14 — forked from jason2506/sorting.hs
[Haskell Practice] some common sorting algorithms
import Data.List
bubbleSort :: (Ord a) => [a] -> [a]
bubbleSort [] = []
bubbleSort (first:[]) = first:[]
bubbleSort (first:remains) =
if first < smallest
then first:(bubbleSort bubbledRemains)
else smallest:(bubbleSort (first:(tail bubbledRemains)))
where bubbledRemains = bubbleSort remains
@oboje
oboje / xargs.sh
Last active December 13, 2017 12:45
xargs examples
#source https://habrahabr.ru/company/selectel/blog/248207
find . -name "*.sh"| xargs rm -rf
find . -name "*.sh"| xargs rm -rf
find . -name "*.sh" -print0 | xargs -0 rm -rf
find /tmp -name "*.tmp"| xargs rm
ls | xargs -p -l gzip
find . -name "*.pl" | xargs tar -zcf pl.tar.gz
ls | sed -e "p;s/.txt$/.sql/" | xargs -n2 fmv
ls | xargs -I FILE mv {} <...>-{}
@oboje
oboje / -
Created December 13, 2017 11:51
1355e36339ed3ea5b82f722491fe5efe