Skip to content

Instantly share code, notes, and snippets.

@uutarou10
uutarou10 / tslint.json
Created August 31, 2018 06:10
ぼくのかんがえたさいきょうのtslint.json(ただの好み)
{
"extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"],
"linterOptions": {
"exclude": [
"config/**/*.js",
"node_modules/**/*.ts"
]
},
"rules": {
"variable-name": [true, "allow-leading-underscore"],
@uutarou10
uutarou10 / rx-practice.js
Created August 14, 2018 03:56
RxJSの練習、キモすぎる。
const axios = require('axios');
const Rx = require('rxjs');
const { mergeMap, mapTo } = require('rxjs/operators');
const getArticles = () => (
axios.get('https://qiita.com/api/v2/users/uutarou10/items')
.then(res => {
return res.data
})
);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script>
function openWindow() {
const win = window.open('./sub.html')
@uutarou10
uutarou10 / main.js
Created July 5, 2018 06:55
チャンネルが凍りつくSlack bot
const { RTMClient } = require('@slack/client');
const token = ENV.SLACK_TOKEN
const rtm = new RTMClient(token)
rtm.start();
rtm.on('message', event => {
messages = [
'黙れよ',
'ド素人が',
wget --spider -nv --timeout 10 -t 1 http://hogehoge.cloud.teu.ac.jp
if [ $? = 0 ]; then
curl -X POST --data-urlencode 'payload={"text":"復活なう!\n急げ!"}' https://hooks.slack.com/services/xxxxxxxxxxxxxx
fi
0 5
1 17
2 5
3 11
4 3
5 3
6 11
7 17
8 13
9 7
     東   西   南   北
入口 7.223 0.000 0.124 0.000
森 8.699 0.375 0.036 0.000
湖 0.000 0.133 9.948 0.000
池 0.088 0.000 0.000 0.549
草原 0.000 0.078 0.000 0.387
宝 0.000 0.000 0.000 0.000
@uutarou10
uutarou10 / main.go
Created June 19, 2017 06:02
Go言語きもちわるい
package main
import "fmt"
func main() {
var int string
int = "hello"
fmt.Println(int)
}
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
exports.sayHello = () => {
console.log('Hello browserify!')
}
},{}],2:[function(require,module,exports){
const hello = require('./hello.js')
hello.sayHello()
$(() => {
$('#comment-area button').click(() => {
$.post('api/comment', {comment: $('#comment').val()})
.done(() => {
console.log('success!')
})
})
})