This file contains hidden or 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(){ | |
const svg = document.querySelector('svg'); | |
const svgData = new XMLSerializer().serializeToString(svg); | |
const canvas = document.createElement('canvas'); | |
canvas.width = svg.width.baseVal.value; | |
canvas.height = svg.height.baseVal.value; | |
const ctx = canvas.getContext('2d'); | |
const image = new Image; | |
image.onload = function(){ |
This file contains hidden or 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
from keras.models import Sequential, Model | |
from keras.layers import * | |
import os | |
import sys | |
from keras.datasets import mnist | |
from keras.optimizers import Adam | |
from PIL import Image | |
import math | |
import numpy as np | |
import keras.backend as K |
This file contains hidden or 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
// ==UserScript== | |
// @name Twitter使いやすく | |
// @version 1.11 | |
// @grant none | |
// @include https://twitter.com/* | |
// ==/UserScript== | |
// ツイートクリック時にユーザーページに飛ぶのを防ぐ | |
const currentPath = '/'+document.location.href.match(/twitter.com\/(.*)/)[1]; |
This file contains hidden or 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 xhr = new XMLHttpRequest(); | |
xhr.open("POST", "https://discordapp.com/api/v6/channels/{channelId}/messages", true); | |
xhr.setRequestHeader('Content-Type','application/json'); | |
xhr.setRequestHeader('Authorization',authKey); // check message header | |
xhr.send(JSON.stringify({ | |
content:'somthing message' | |
})); | |
// sample request | |
var xhr = new XMLHttpRequest(); |
This file contains hidden or 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
# 前提1 | |
def generator_model(): | |
input_layer = Input(shape=(100)) | |
# ~~~~ | |
output_layer = Activation('tanh')(layer_x) | |
return model = Model(input_layer, output_layer) # shape=(batchN,28,28,1) | |
# 前提2 | |
def discriminator_model(): | |
input_layer = Input(shape=(28, 28, 11)) |
This file contains hidden or 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
# encoding: utf-8 | |
import asyncio | |
def times_event(bot, wait, ch_id=-1): # event/times/times_event.py | |
ch = bot.get_channel(ch_id) | |
if (ch_id != -1) and (ch is None): | |
Exception('ch is not found') |
This file contains hidden or 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
"vetur.format.defaultFormatterOptions": { | |
"prettier": { | |
"singleQuote": true, | |
"semi": false | |
} | |
} |
This file contains hidden or 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
@charset "UTF-8"; | |
/* Tab bar below Navigation & Bookmarks Toolbars */ | |
#nav-bar { /* main toolbar */ | |
-moz-box-ordinal-group: 1 !important; | |
box-shadow: none !important; | |
} | |
#PersonalToolbar { /* bookmarks toolbar */ | |
-moz-box-ordinal-group: 2 !important; | |
} | |
#TabsToolbar { /* tab bar */ |
This file contains hidden or 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
const Option = function(v){ | |
return Some(x); | |
} | |
class _Some{ | |
constructor(v){ this._v = v } | |
flatMap(f) { | |
const result = f(this._v) | |
return (result.constructor.name === '_Some' || result.constructor.name === 'None') ? | |
result : (function(){ throw new Error('Type Error: required [ flatMap(f: A => Option(B)) ]') }()); |