View gist:9af5701fc8da277b376735a23e31e906
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<h1>utc text 입력</h1> | |
시작시간: <input type="text" id="startInput"></input> | |
</br> | |
끝시간: <input type="text" id="textInput"></input> | |
</br> | |
<button id="inputBtn">변환</button> | |
<div id="result"><div> | |
</html> |
View youtube_playlist.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ -e $(which youtube-dl) ]]; then | |
if [[ -e $(which jq) ]]; then | |
echo 'YouTube 재생목록을 가져오고 있습니다...' | |
youtube-dl -i --playlist-reverse -j --flat-playlist 'https://www.youtube.com/channel/UCB1h4X2J0J-8sVVcHvzQahw' | jq -r '"[" + .title + "](https://youtube.com/v/" + .id + ")"' > results.txt | |
echo 'YouTube 재생목록을 가져왔습니다.' | |
sleep 1 | |
echo 'results.txt 파일에 저장되었습니다.' | |
else | |
if [[ -e $(which brew) ]]; then | |
brew install youtube-dl jq |
View bitwise_operation_xor_00.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int a = 10; | |
int b = 20; | |
int temp; | |
printf("교체 전: %d, %d\n", a, b); // 교체 전: 10, 20 | |
temp = a; | |
a = b; | |
b = temp; | |
printf("교체 후: %d, %d\n", a, b); // 교체 후: 20, 10 |
View bitwise_operation_xor_02.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int a = 10; | |
int b = 20; | |
printf("XOR 전: %d, %d\n", a, b); // XOR 전: 10, 20 | |
a ^= (b ^= (a ^= b)); | |
printf("XOR 후: %d, %d\n", a, b); // XOR 후: 20, 10 |
View bitwise_operation_xor_01.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int a = 10; | |
int b = 20; | |
printf("XOR 전: %d, %d\n", a, b); // XOR 전: 10, 20 | |
a = a ^ b; | |
b = a ^ b; | |
a = a ^ b; | |
printf("XOR 후: %d, %d\n", a, b); // XOR 후: 20, 10 |
View bot.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const schedule = require('node-schedule'); | |
schedule.scheduleJob('0 0 * * * *', () => { | |
var chatParticipantFile = fs.readFileSync('./chat_participant.txt', 'utf8'); | |
var chatParticipant = chatParticipantFile.split('\n'); | |
chatParticipant.forEach((element, index, array) => { | |
if (element) { | |
bot.sendMessage(element, '정각입니다.', {disable_notification: true}); | |
} | |
}); |
View bot.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const shell = require('./modules/shell'); | |
var shellRegex = new RegExp('^/shell(' + BOTNAME + ')?$', 'i'); | |
bot.onText(shellRegex, (msg, match) => { | |
var messageId = msg.message_id; | |
var chatId = msg.chat.id; | |
var fromId = msg.from.id; | |
var opts = { | |
reply_markup: JSON.stringify({force_reply: true, selective: true}), | |
reply_to_message_id: messageId |
View bot.ping.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bot.onText(/^(ping|핑)[!]?$/i, (msg, match) => { | |
var messageId = msg.message_id; | |
var chatId = msg.chat.id; | |
if (match[1].match(/ping/i)) { | |
bot.sendMessage(chatId, 'Ping!', {reply_to_message_id: messageId}); | |
} else if (match[1].match(/핑/)) { | |
bot.sendMessage(chatId, '퐁!', {reply_to_message_id: messageId}); | |
} | |
}); |
View bot.javascript.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const javascript = require('./modules/javascript'); | |
var jsRegex = new RegExp('^/js(' + BOTNAME + ')?$', 'i'); | |
bot.onText(jsRegex, (msg, match) => { | |
var messageId = msg.message_id; | |
var chatId = msg.chat.id; | |
var fromId = msg.from.id; | |
var opts = { | |
reply_markup: JSON.stringify({force_reply: true, selective: true}), | |
reply_to_message_id: messageId |
View .eslintrc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
"env": { | |
"browser": true, | |
"es6": true, | |
"node": true | |
}, | |
"extends": "standard", | |
"plugins": [ | |
"standard", | |
"promise" |
NewerOlder