Skip to content

Instantly share code, notes, and snippets.

View nesffer's full-sized avatar
🐧

Nesffer nesffer

🐧
View GitHub Profile
<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>
@nesffer
nesffer / youtube_playlist.sh
Last active May 4, 2020 07:28
YouTube playlist export
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
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
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
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
@nesffer
nesffer / bot.js
Last active November 9, 2019 11:54
텔레그램 봇 정각알림
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});
}
});
@nesffer
nesffer / bot.js
Created November 3, 2016 05:44
Telegram Bot Shell
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
@nesffer
nesffer / bot.ping.js
Created November 3, 2016 03:40
bot.ping.js
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});
}
});
@nesffer
nesffer / bot.javascript.js
Last active November 3, 2016 06:22
bot.javascript.js
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
@nesffer
nesffer / .eslintrc.js
Last active October 5, 2017 19:03
.eslintrc.js
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "standard",
"plugins": [
"standard",
"promise"