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
/* | |
TinyMCE | |
1. Create a JavaScript file that defines your plugin's functionality. This file should contain a single function that takes a TinyMCE editor instance as an argument and registers your plugin's behavior with the editor. | |
2. In your TinyMCE configuration, include the path to your plugin's JavaScript file in the plugins array. | |
*/ | |
tinymce.PluginManager.add('myplugin', function(editor, url) { | |
editor.addButton('mybutton', { | |
text: 'My Button', | |
icon: false, | |
onclick: function() { |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
export async function getStaticPaths() { | |
// ตรงนี้สามารถ List Content ทั้งหมดผ่าน API ได้ | |
// และใส่เป็น params | |
return { | |
paths: [ | |
{ | |
params: { | |
title: 'some-content-title', | |
}, | |
}, |
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
----------------------------- | |
2c.รายได้ทุกปีแต่ละจังหวัด | |
----------------------------- | |
Bangkok | |
median: 5 | |
mean: 37416.7 | |
mode: 26054 | |
sd: 8509.53 | |
per 90: 48951 | |
per 95: 49071 |
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 { HttpLink } from 'apollo-link-http'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
import { onError } from 'apollo-link-error'; //add apollo error link | |
import { ApolloLink } from 'apollo-link'; // add apollo link | |
const httpLink = new HttpLink({ | |
uri: 'http://localhost:8080/graphql', | |
}); | |
const errorLink = onError(({ graphQLErrors, networkError }) => { |
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 { HttpLink } from 'apollo-link-http'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
const httpLink = new HttpLink({ | |
uri: 'http://localhost:8080/graphql', | |
}); | |
const client = new ApolloClient({ | |
link: httpLink, | |
cache: new InMemoryCache(), |
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 banList = ['avenger', 'infinity']; | |
setInterval(function() { | |
var a = document.querySelectorAll('[role="article"]') | |
a.forEach((d) => { | |
banList.map((text) => { | |
if (d.innerText.toLocaleLowerCase().indexOf(text) >= 0) { | |
console.log('removed'); | |
d.remove() | |
} | |
}) |
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
// read.js | |
const data = requre('./entity') | |
data() | |
.then((list) => { | |
console.log(list) | |
}) | |
-------------------------- | |
// entity.js |
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
<?php | |
$SITE_ROOT = "https://www.example.com"; | |
$jsonData = getData($SITE_ROOT); | |
makePage($jsonData, $SITE_ROOT); | |
function getData($siteRoot) { | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); |
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 ApolloClient from 'apollo-client'; | |
import { getOperationAST } from 'graphql'; | |
import { ApolloLink } from 'apollo-link'; | |
import { HttpLink } from 'apollo-link-http'; | |
import { WebSocketLink } from 'apollo-link-ws'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
import fetch from 'isomorphic-fetch'; | |
import WebSocket from 'ws'; | |
let apolloClient = null; |
NewerOlder