Skip to content

Instantly share code, notes, and snippets.

View nesffer's full-sized avatar
🐧

Nesffer nesffer

🐧
View GitHub Profile
@nesffer
nesffer / Python3.5-Build.txt
Last active October 27, 2023 10:52
Python 3.5 Build on Ubuntu 14.04.3
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_dbm _gdbm _lzma
_sqlite3 _ssl _tkinter
readline zlib
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
sudo apt-get install libbz2-dev libncurses5-dev libgdbm-dev liblzma-dev sqlite3 libsqlite3-dev openssl libssl-dev tcl8.6-dev tk8.6-dev libreadline-dev zlib1g-dev
<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 / baseball.py
Created October 16, 2015 04:46
[Python] 야구 게임
# -*- coding: utf-8 -*-
# 랜덤 숫자 1~5
from random import randint
a = randint(1, 5)
b = randint(1, 5)
c = randint(1, 5)
# 랜덤 숫자 1~5
# a = 2
@nesffer
nesffer / python-added-urlopen.py
Created March 15, 2016 00:19
파이썬에서 query, header 추가해서 urlopen 사용하기
import urllib.parse
import urllib.request
url = 'http://example.com'
values = {'name': 'nesffer',
'query': 'python'}
headers = {'Content-Type': 'text/plain'}
data = urllib.parse.urlencode(values).encode('utf-8')
req = urllib.request.Request(url, data, headers)
f = urllib.request.urlopen(req)
@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
@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});
}
});
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 = a ^ b;
b = a ^ b;
a = 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 ^= (b ^= (a ^= b));
printf("XOR 후: %d, %d\n", a, b); // XOR 후: 20, 10
@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"