Skip to content

Instantly share code, notes, and snippets.

View potato4d's full-sized avatar
💭
It's not so easy to be consistent

Takuma HANATANI potato4d

💭
It's not so easy to be consistent
View GitHub Profile
<template>
<section class="container">
<img :src="`https://github.com/${user.login}.png`" :alt="user.name">
<h1>{{user.name}}</h1>
</section>
</template>
<script>
import axios from 'axios'
@potato4d
potato4d / index.js
Created September 20, 2017 03:16
AWS LambdaでMisskeyの通知を受けるやつ
exports.handler = function(_, __, callback){
const axios = require('axios');
const firebase = require('firebase');
const misskey = Object.assign({}, axios);
// 悪
const CSRF_TOKEN = 'YOUR-MISSKEY-CSRF-TOKEN'
const APPNO = 'YOUR-PUSH7-APPNO'
const APIKEY = 'YOUR-PUSH7-APIKEY'
const COOKIE = 'YOUR MISSKEY.LINK COOKIE';
<script>
p7.ready()
.then(function(p7){
const $$ = function(e){ return document.querySelectorAll(e) };
for(var button of $$('.subscribe-button')){
button.addEventListener('click', function(){
p7.subscribe();
})
}
})
{
"event":"push",
"type":"UserChat",
"entity":{
"id":"149139",
"channelId":"1148",
"personType":"Veil",
"personId":"599bf2f432e826c8",
"state":"open",
"lastMessageId":"599bf2fe223aeff7",
@potato4d
potato4d / ERROR
Last active March 30, 2017 08:36
no_unnecessary_double_quotes problem on coffeelint
[potato4d@Potato4d cfl_test]$ npm run test
> [email protected] test /Users/potato4d/Desktop/cfl_test
> coffeelint application.coffee
⚡ application.coffee
⚡ #2: Unnecessary double quotes are forbidden.
⚡ Warning! » 0 errors and 1 warning in 1 file
@potato4d
potato4d / file2.js
Last active February 21, 2017 00:37
英語資料を読むのが面倒な人のためのwebpack 2移行ガイド ref: http://qiita.com/potato4d/items/4975c3d9c5fe56fa78c1
const services = []
const serviceList = ["serviceA", "serviceB", "serviceD"];
serviceList.map((s)=>{
System.import("./services/" + s)
.then((mod)=>{
services.push(mod);
})
});
@potato4d
potato4d / fizzbuzz.js
Last active February 12, 2017 17:44
なんかTLではやってたので
Array(20).fill(0).map((_,i)=>i?((!(i%3)?"Fizz":'')+(!(i%5)?"Buzz":''))||i:0)
@potato4d
potato4d / .bashrc
Last active December 20, 2018 01:27
「ちょっと確認」のHTTPサーバー起動にはpocke/wwwが便利 ref: https://qiita.com/potato4d/items/56b359f1ab9ab932611e
alias http="open http://0.0.0.0:8080 & php -S 0.0.0.0:8080"
@potato4d
potato4d / oauth.js
Last active December 14, 2016 15:43
electron-oauth-twitterでElectronでのTwitter OAuth認証を手軽に行う ref: http://qiita.com/potato4d/items/a4a2c9cb5667135f0748
const dialog = require('electron').dialog;
const OauthTwitter = require('electron-oauth-twitter');
const twitter = new OauthTwitter({
key : "YOUR_TWITTER_KEY",
secret: "YOUR_TWITTER_SECRET",
});
twitter.startRequest()
@potato4d
potato4d / bookmarklet.js
Created December 13, 2016 10:07
Wantedlyで応援をお願いされた時にまとめてクリックするブックマークレット
javascript:document.querySelectorAll(`#suggest-supports-of-friend-companies-form .support-project-title.with_avatar > input[type="checkbox"]`).forEach(e=>e.click());