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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>JavaScript Sample</title> | |
<script> | |
window.onload = function () { | |
// DOM 조작하기 | |
let statusNum = 1; | |
const myParagraph = document.getElementById("my-paragraph"); |
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
import requests | |
REDIT_URL = 'https://www.reddit.com' | |
ML_TOP_URL = 'https://www.reddit.com/r/machinelearning/top.json?redditWebClient=mweb2x&layout=classic&raw_json=1&withAds=true&subredditName=machinelearning&sort=top&t=day&feature=link_preview&sr_detail=true&app=2x-client-production' | |
HEADERS = {'User-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1'} | |
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
# Python 3, TensorFlow 1.0 | |
import os | |
import tensorflow as tf | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("./mnist/data/", one_hot=True) | |
######### |
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
var mecab = require('mecab-ya'); | |
var text = '아버지가방에들어가신다'; | |
mecab.pos(text, function (err, result) { | |
console.log(result); | |
/* | |
[ [ '아버지', 'NNG' ], | |
[ '가', 'JKS' ], | |
[ '방', 'NNG' ], |
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
(require 'package) | |
(package-initialize) | |
(setq package-archives '(("marmalade" . "https://marmalade-repo.org/packages/") | |
("melpa" . "https://melpa.org/packages/"))) | |
(require 'helm) | |
(require 'helm-ag) | |
(require 'helm-projectile) | |
(require 'magit) | |
(require 'yasnippet) |
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
function MyDate (args) { | |
var MICROSECONDS_OF_A_DAY = 86400000, | |
today = args ? new Date(args) : new Date(), | |
daysOfThisSunday = Math.floor(today.getTime() / MICROSECONDS_OF_A_DAY) - today.getDay(); | |
var dayNames = { | |
SUN: 0, MON: 1, TUE: 2, WED: 3, THU: 4, FRI: 5, SAT: 6 | |
}; | |
return { |
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
var nodeunit = require('nodeunit'), | |
promiseFuncs = require(__dirname + '/../index'); | |
exports['Promise unit test'] = nodeunit.testCase({ | |
'success from Q': function (test) { | |
promiseFuncs.success() | |
.then(test.ok) | |
.fail(console.log) | |
.done(test.done); |
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
var _ = require('lodash'); | |
var numbers = [1, 2, 3]; | |
var result = | |
_.map(numbers, function (val) { // numbers를 전부 돌면서 값에 1씩 더해서 새로운 배열을 리턴한다. | |
return val + 1; | |
}) | |
.filter(function (val) { // 위에서 생성된 배열에서 값이 2보다 큰 요소만 배열로 만들어서 리턴한다. | |
return val > 2; |
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
/* | |
* 3,6,9 치트 스크립트 | |
* 3,6,9 는 박수, 0에서는 키스, 5에서는 만세. | |
* 액션을 숫자가 나오는 순서에 맞춰야함. 중복도 쳐야함. | |
* 예) 43 : :clap: | |
* 39 : :clap: :clap: | |
* 50 : :raised_hands: :kiss: | |
*/ | |
var Cheat369 = { |
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
// 더미 데이터 생성 | |
for (var i = 0; i < 100000; ++i) { | |
var arr = []; | |
var size = Math.floor(Math.random() * 10); | |
for (var j = 0; j < size; ++j) { | |
var doc = {}; | |
doc["prop" + j] = Math.floor(Math.random() * 1000); | |
arr.push(doc); | |
} |