Skip to content

Instantly share code, notes, and snippets.

View sunkibaek's full-sized avatar
💻
Coding

Sunki Baek sunkibaek

💻
Coding
  • Calgary
View GitHub Profile
const arrowFunction = () => {
console.log("== Inside of arrowFunction!");
};
const regularFunction = function () {
console.log("== Inside of regularFunction!");
};
const main = (firstCallback, secondCallback) => {
console.log("== Inside of main!");
const main = (callback) => {
console.log("== Inside of main!");
callback();
};
main(() => {
console.log("== Inside of callback!");
});
// == Inside of main!
const simpleCallback = () => {
console.log("== Inside of callback!");
};
const main = (callback) => {
console.log("== Inside of main!");
callback();
};
main(simpleCallback);
@sunkibaek
sunkibaek / git-cheat-sheet.md
Last active April 26, 2020 22:30
git cheat sheet

설치

macOS

macOS에서는 brew를 이용하여 설치하면 관리가 용이합니다.

brew install git
ffmpeg -i ./filename.mp4 -vf scale=-1:720 -crf 20 -c:a copy filename_720p.mp4
function update-type {
cd ~/apps/type
git pull
export LAST_TYPE_REPO_HASH="`git rev-parse HEAD`"
echo $LAST_TYPE_REPO_HASH
cd -
npm install --save git+ssh://git@github.com/huiseoul/type.git#$LAST_TYPE_REPO_HASH
}
@sunkibaek
sunkibaek / promise-all-with-timeout.js
Last active December 16, 2017 02:01
Promise all with timeout
const timedPromise = () => {
return new Promise((resolve, reject) => {
console.log('promise1 started');
setTimeout(() => {
resolve('promise1')
}, 3000);
});
}
@import url(http://fonts.googleapis.com/earlyaccess/notosanskr.css);
$black: rgba(0, 0, 0, .87);
html {
color: $black;
font-family: "Noto Sans KR", sans-serif;
font-weight: normal;
line-height: 1.5;
}
@sunkibaek
sunkibaek / NullDateTime.rb
Created March 13, 2016 08:07
NullDateTime
class NullDateTime
def in_time_zone(_city = 'DefaultTimeZoneCity')
self
end
def to_s(_format = :default_date_time)
''
end
end
@sunkibaek
sunkibaek / anagram.rb
Last active September 11, 2015 10:57
Some algorithm problems solved in Ruby
def anagram?(string, candidate)
string.chars.sort == candidate.chars.sort
end
require 'minitest/autorun'
class Test < MiniTest::Test
def test_anagram
assert anagram?('beta', 'bate')
assert anagram?('beta', 'beat')