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
const fs = require('fs'); | |
const path = require('path'); | |
const glob = require('glob'); | |
const sass = require('node-sass'); | |
const commandLineArgs = require('command-line-args'); | |
// コマンドラインオプションの定義 | |
const optionDefinitions = [ | |
{ | |
name: 'file', |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<style> | |
html, body { | |
width: 100%; |
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
(1.2 / 0.625 / 100) * 100 | |
https://www.google.com/search?&q=(1.2+/+0.625+/+100)+*+100 |
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 fs = require('fs') | |
var sass = './src/sass/menu.sass'; | |
fs.readFile(sass, 'utf8', function (err,data) { | |
if (err) { | |
return console.log(err); | |
} | |
// console.log(data) | |
var result = data.replace(/rem\((.*?)\)/g, function(match) { | |
console.log(match) | |
var m = match.match(/[\d+\.]+/); |
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
const devices = require('puppeteer/DeviceDescriptors'); | |
let fetch = require('node-fetch'); | |
let FormData = require('form-data'); | |
let fs = require('fs'); | |
let opener = require('opener'); | |
it('スマートフォン版のスクリーンショットを撮影', async function () { | |
this.timeout(20000); | |
await page.emulate(devices['iPhone 6']); | |
await page.screenshot({ |
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 closest(node, selector) { | |
// IEや一部ブラウザでは.closet()が実装されていないので自前も用意 | |
return (node.closest || function (_selector) { | |
do { | |
// nodeとselectorがマッチしたら返す | |
if ((node.matches || node.msMatchesSelector).call(node, _selector)) { | |
return node; | |
} | |
// マッチしなかったら親要素を代入 |
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 lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=640, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>サービス名</title> | |
<style> | |
html, body { | |
padding: 0; |
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
// Register a REST route | |
add_action( 'rest_api_init', function () { | |
//Path to meta query route | |
register_rest_route( 'boardgame/v2', '/fedrated_query/', array( | |
'methods' => 'GET', | |
'callback' => 'custom_meta_query' | |
) ); | |
}); | |
// Do the actual query and return the data |
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 my_acf_load_field( $field ) { | |
if ( ! empty ( $_GET[$field['name']] )) { | |
$field['default_value'] = $_GET[$field['name']]; | |
} | |
return $field; | |
} | |
add_filter('acf/load_field', 'my_acf_load_field'); | |
remove_filter( 'the_content', 'wpautop' ); |