json VSCode_markdown_snippets

markdown.json
{
  // Place your snippets for markdown here. Each snippet is defined under a snippet name and has a prefix, body and
  // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
  // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
  // same ids are connected.
  // Example:
  // "Print to console": {
  // 	"prefix": "log",
  // 	"body": [
  // 		"console.log('$1');",
  // 		"$2"
  // 	],
  // 	"description": "Log output to console"
  // }
  "info": {
    "prefix": "info",
    "body": ["{% hint style=\"info\" %}", "$1", "{% endhint %}"]
  },
  "img": {
    "prefix": "img",
    "body": "![]($1)"
  },
  "br_line": {
    "prefix": "br_line",
    "body": "  \n"
  },
  "link": {
    "prefix": "link",
    "body": "[$1]($2)"
  },
  "img_png": {
    "prefix": "img_png",
    "body": "[]($1.png)"
  },
  "summary": {
    "prefix": "summary",
    "body": "<!-- SUMMARY:$1 -->"
  }
}

json cthulu_v6

cthulu_v6

AnastasiaZinca.json
{
  "stats": {
    "apparence": 13,
    "constitution": 11,
    "dexterite": 10,
    "force": 8,
    "taille": 10,
    "education": 14,
    "intelligence": 16,
    "pouvoir": 8,
    "prestance": 65,
    "endurance": 55,
    "agilite": 55,
    "puissance": 40,
    "corpulence": 50,
    "connaissance": 65,
    "intuition": 80,
    "volonte": 40,
    "aplomb": 0,
    "impact": 0
  },
  "etatcivil": {
    "nom": "Zinca",
    "prenom": "Anastasia",
    "occupation": "Détective amateur",
    "age": 29,
    "profession": "Photographe",
    "personnalite": "'Rough' selon certains",
    "nationalite": "Roumaine - Américaine",
    "sexe": "Femme"
  },
  "cercleInfluence": {
    "proche": [],
    "eloignes": [
      "Philip Baxter"
    ],
    "opposes": [],
    "ennemi": []
  },
  "sante": {
    "protections": [],
    "seuilDeBlessure": 5,
    "seuilPv": 11,
    "blessures": [],
    "santeMentale": 40,
    "mana": 8,
  },
  "occupation": {
    "archetype": "Artiste",
    "equipementFetiche": "+ 10% en Pratique Artistique à son atelier",
    "nomDeCompetence": "Interpréter différemment les faits",
    "niveauDeVie": "Propriétaire"
  },
  "competences": {
    "langueMaternelle": "Américain",
    "langues": [
      {
        "nom": "Roumain",
        "valeur" : 2
      }
    ],
    "competenceOccupation": 80,
    "photographie": 70,
    "sciencesDeLaVie": [],
    "sciencesFormelles": [
      {
        "nom": "Mathématiques",
        "valeur": 70
      },
      {
        "nom": "Chimie",
        "valeur": 80
      }
    ],
    "sciencesHumaines": [
      {
        "nom": "Psychologie",
        "valeur": 70
      }
    ],
    "equitation": 70,
    "ecouter": 70,
    "vigilance": 75,
    "corpsACorps": {
      "nom": "Coup de talon",
      "effet": "1D6 + 1"
    }
  },
  "equipementFetiche": {
    "nom": "Nagel Recomar 18, 6x9cm plate view",
    "valeur": 80
  },
  "arme": "Aucune",
  "imgurl": "https://i.ibb.co/TDGFvsX/vintage-tight-corset-victorian-era-03.jpg",
  "publish": true
}

json 00_AutoAddress.md

00_AutoAddress.md
# 住所入力フォーム

- components/form.vue
- store/prefectures.js
- assets/json/prefectures.json

cf. https://programmer-beginner.com/zip-auto-address#i-4
form.vue
<template>
<section>
<form class="form" @submit.prevent="changeAddress">
    <div class="group-control" data-form="address-postal-code">
    <label for="postal-code">郵便番号</label>
    <input
        id="postal-code"
        name="postal-code"
        v-model="zipcode"
        type="number"
        placeholder="1500001"
        @input="fetchAddress" />
    </div>
    <div class="group-control" data-form="address-prefecture">
    <label for="prefecture">都道府県</label>
    <select
        id="prefecture"
        name="prefecture"
        v-model="prefecture"
        placeholder="都道府県を選択">
        <option
        v-for="(prefecture, index) in prefectures"
        :key="index"
        :label="prefecture.name"
        :value="prefecture.name" />
    </select>
    </div>
    <div class="group-control" data-form="address-city">
    <label for="city">市区町村</label>
    <input
        id="city"
        name="city"
        v-model="address"
        type="text"
        placeholder="渋谷区神宮前" />
    </div>
</form>
</section>
</template>

<script>
import axiosJsonpAdapter from 'axios-jsonp'
const ZIPCODE_API_URL = 'http://zipcloud.ibsnet.co.jp/api/search'

export default{
  data(){
    return{
      zipcode: '',
      prefecture: '',
      address: '',
    }
  },
  computed: {
    prefectures() {
      return this.$store.getters['prefectures/getAll'].prefectures
    }
  },
  methods:{
    async changeAddress(evt){
      // await this.$axios.put('/me/address',{})
    },
    async fetchAddress() {
      if (!/^\d{7}$/.test(this.zipcode)) return

      const res = await this.$axios.$get(ZIPCODE_API_URL, {
        adapter: axiosJsonpAdapter,
        params: {
          zipcode: this.zipcode
        }
      })

      if (res.status !== 200) return

      this.prefecture = res.results[0].address1
      this.address = res.results[0].address2 + res.results[0].address3
    },
  }
}
</script>
prefectures.js
import jsonData from '~/assets/json/prefectures.json'

export const state = () => ({
  data: jsonData,
})

export const getters = {
  getAll (state) {
    return state.data
  },
}
prefectures.json
{
  "prefectures": [
    { "code": 1, "name": "北海道" },
    { "code": 2, "name": "青森県" },
    { "code": 3, "name": "岩手県" },
    { "code": 4, "name": "宮城県" },
    { "code": 5, "name": "秋田県" },
    { "code": 6, "name": "山形県" },
    { "code": 7, "name": "福島県" },
    { "code": 8, "name": "茨城県" },
    { "code": 9, "name": "栃木県" },
    { "code": 10, "name": "群馬県" },
    { "code": 11, "name": "埼玉県" },
    { "code": 12, "name": "千葉県" },
    { "code": 13, "name": "東京都" },
    { "code": 14, "name": "神奈川県" },
    { "code": 15, "name": "新潟県" },
    { "code": 16, "name": "富山県" },
    { "code": 17, "name": "石川県" },
    { "code": 18, "name": "福井県" },
    { "code": 19, "name": "山梨県" },
    { "code": 20, "name": "長野県" },
    { "code": 21, "name": "岐阜県" },
    { "code": 22, "name": "静岡県" },
    { "code": 23, "name": "愛知県" },
    { "code": 24, "name": "三重県" },
    { "code": 25, "name": "滋賀県" },
    { "code": 26, "name": "京都府" },
    { "code": 27, "name": "大阪府" },
    { "code": 28, "name": "兵庫県" },
    { "code": 29, "name": "奈良県" },
    { "code": 30, "name": "和歌山県" },
    { "code": 31, "name": "鳥取県" },
    { "code": 32, "name": "島根県" },
    { "code": 33, "name": "岡山県" },
    { "code": 34, "name": "広島県" },
    { "code": 35, "name": "山口県" },
    { "code": 36, "name": "徳島県" },
    { "code": 37, "name": "香川県" },
    { "code": 38, "name": "愛媛県" },
    { "code": 39, "name": "高知県" },
    { "code": 40, "name": "福岡県" },
    { "code": 41, "name": "佐賀県" },
    { "code": 42, "name": "長崎県" },
    { "code": 43, "name": "熊本県" },
    { "code": 44, "name": "大分県" },
    { "code": 45, "name": "宮崎県" },
    { "code": 46, "name": "鹿児島県" },
    { "code": 47, "name": "沖縄県" }
  ]
}

json 行基本讯息

Line
{
  "events": [
    {
      "type": "message",
      "replyToken": "60f222151e3c424c9b6cb5f8981ba618",
      "source": {
        "userId": "userId",
        "type": "user"
      },
      "timestamp": 1560517215415,
      "message": {
        "type": "text",
        "id": "10041050475410",
        "text": "Hello Line"
      }
    }
  ],
  "destination": "U2ca128b965d9ac85048112054f8c9006"
}

json 设置VSCODE

settings

{
  "editor.fontFamily": "Operator Mono, Menlo, Monaco, 'Courier New', monospace",
  "editor.fontSize": 15,
  "editor.lineHeight": 30,
  "editor.quickSuggestionsDelay": 30,
  "editor.letterSpacing": 0.5,
  "workbench.editor.tabSizing": "shrink",
  "html.format.enable": true,
  "html.format.preserveNewLines": true,
  "files.trimTrailingWhitespace": true,
  "editor.tabSize": 2,
  "editor.cursorWidth": 5,
  // this isn't really underline but we hack it to be a thicker cursor
  "editor.cursorStyle": "line",
  "editor.wordWrap": "on",
  "editor.fontWeight": "400",
  "editor.cursorBlinking": "expand",
  "editor.colorDecorators": true,
  "editor.minimap.enabled": false,
  "workbench.activityBar.visible": true,
  "workbench.sideBar.location": "left",
  "editor.renderWhitespace": "none",
  "editor.rulers": [100, 100],
  "editor.minimap.showSlider": "always",
  "extensions.ignoreRecommendations": false,
  "files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/CVS": true,
    "**/.DS_Store": true,
    "**/.next": true
  },
  "workbench.colorTheme": "Cobalt2",
  "workbench.editor.tabCloseButton": "off",
  "emmet.includeLanguages": {
    "javascript": "javascriptreact"
  },
  // show snippets before any other auto completion
  "editor.snippetSuggestions": "top",
  // this lets you quick open multiple items in a row and now have the previous ones closed on you
  "workbench.editor.enablePreviewFromQuickOpen": false,
  "window.title": "${dirty} ${activeEditorMedium}${separator}${rootName}",
  // These are all my auto-save configs
  "editor.formatOnSave": true,
  // turn it off for JS
  "[javascript]": {
    "editor.formatOnSave": true
  },
  "[typescript]": {
    "editor.formatOnSave": true
  },
  // tell the ESLint plugin to run on save
  "eslint.autoFixOnSave": true,
  // Optional: If you have the prettier extension enabled for other languages like CSS and HTML, turn it off for JS since we are doing it through Eslint already
  "prettier.disableLanguages": ["js"],
  "eslint.alwaysShowStatus": true,
  "editor.autoIndent": true,
  "window.closeWhenEmpty": true,
  "editor.detectIndentation": false,
  "files.insertFinalNewline": true,
  "editor.showFoldingControls": "always",
  "editor.find.seedSearchStringFromSelection": true,
  "editor.matchBrackets": true,
  "workbench.editor.enablePreview": true,
  "editor.scrollBeyondLastLine": true,
  "editor.useTabStops": true,
  "editor.formatOnPaste": true,
  "window.zoomLevel": 0,
  "editor.parameterHints.enabled": false
}

json 一个测试

一个测试

hello.json
sadf

json 循环显示总数

script.js
let total = 0;
for (let i = 0; i < cashflowGraphScope.IncomeItems.length; i++) {
	const income = cashflowGraphScope.IncomeItems[i];
	total = total + income.Data[spendIndex];
	formattedString += `
	<div class="dq_l-flex">${income.DisplayName}
	<span class="dq_l-flex-push"]>£${cashflowGraphScope.FormatNumber(income.Data[spendIndex])}: (${Math.ceil(self.points[i].percentage)}%)</span>
	</div>`;
}
formattedString += `</div>`;
formattedString += `<div class="dq_l-flex dq_mb">`;
formattedString += `<b>Total income</b><span class="dq_l-flex-push">£ ${total} </span>`;
formattedString += `</div>`;
return formattedString;
data.json
[
  {
    "StartYear": 2019,
    "Data": [
      50000,
      50650,
      51308,
      51975,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "DisplayName": "Salary",
    "Type": "Income"
  },
  {
    "StartYear": 2019,
    "Data": [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "DisplayName": "PCLS",
    "Type": "Income"
  },
  {
    "StartYear": 2019,
    "Data": [
      0,
      0,
      0,
      48144,
      48192,
      48240,
      48288,
      48337,
      48385,
      48433,
      48482,
      48530,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "DisplayName": "Annuity",
    "Type": "Income"
  },
  {
    "StartYear": 2019,
    "Data": [
      0,
      0,
      0,
      36108,
      36144,
      36180,
      36216,
      36252,
      36289,
      36325,
      36361,
      36397,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "DisplayName": "State pension",
    "Type": "Income"
  },
  {
    "StartYear": 2019,
    "Data": [
      0,
      0,
      0,
      2006,
      2008,
      2010,
      2012,
      2014,
      2016,
      2018,
      2020,
      2022,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "DisplayName": "Benefits",
    "Type": "Income"
  },
  {
    "StartYear": 2019,
    "Data": [
      0,
      0,
      0,
      12036,
      12048,
      12060,
      12072,
      12084,
      12096,
      12108,
      12120,
      12132,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "DisplayName": "Other",
    "Type": "Income"
  }
]

json appstore中的createml应用程序

.swift
search "create ml site: https://developer.apple.com/"

Templates:
  Object Detection
  Image Classifier
  Sound Classification
  Text
  Recommendation
  Table
  Motion
  
Annotations format are in annotation files

Drag and Drop inputData folder which comprises all the images as well as the json file
Test the model real time using output tab which allows detection of classification on phone's camera
annotation_objectDetector.json
Annotations JSON Format
[
 {"image":"image1.jpg",
 "annotations":
 [{"label":"carrot",
 "coordinates":{"x":120,"y":164,"width":230,"height":119}
 },
 {"label":"orange",
 "coordinates":{"x":230,"y":321,"width":50,"height":50}
 }
 ]
 },
 ...
] 

json Bot-Net Crafter

main.py
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
from selenium.webdriver.support import expected_conditions as EC # available since 2.26.0
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By

import json
import time


# read botnetConfig.json data
with open('botnetConfig.json') as data_file:
    botnet = json.load(data_file)
print(botnet)
bots = botnet["bots"]

for bot in bots:
    # Create a new instance of the Firefox driver
    driver = webdriver.Firefox(executable_path='/home/nau/sourceProgramsToInstall/geckodriver')


    # TEMP MAIL GENERATE
    print "Opening temp-mail.org to create an email account"
    driver.get("https://temp-mail.org/en/")
    email = driver.find_element_by_id("mail").get_attribute("value")
    print email

    # Save the window opener (current window, do not mistaken with tab... not the same)
    window_email = driver.window_handles[0]
    # open new tab
    #driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL + "t")

    #
    # TWITTER SIGNUP
    #
    print "Opening twitter.com/signup to create a twitter account"
    driver.execute_script('''window.open("http://www.twitter.com/signup","_blank");''')

    # Save the window opener (current window, do not mistaken with tab... not the same)
    window_twitter = driver.window_handles[1]
    # Put focus on current window which will, in fact, put focus on the current visible tab
    driver.switch_to_window(window_twitter)

    delay = 10 # seconds
    # wait until the page is loaded, in this case, wait unitl the element with id='full-name' is loaded
    myElem = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.ID, 'full-name')))

    print driver.title

    driver.find_element_by_id("full-name").send_keys(bot["full-name"])
    driver.find_element_by_id("email").send_keys(email)
    driver.find_element_by_id("password").send_keys(bot["password"])
    driver.find_element_by_id("submit_button").submit()


    # PHONE Verification
    myElem = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.ID, 'phone_number')))
    driver.find_element_by_id("phone_number").send_keys(botnet["phone-number"])
    driver.find_element_by_name("discoverable_by_mobile_phone").click()#checkbox click
    driver.find_element_by_name("call_me").submit()


    code = raw_input('input something!: ')
    driver.find_element_by_id("code").send_keys(code)
    driver.find_element_by_id("code").submit()


    #
    # TWITTER APPS TOKEN GENERATION
    #
    print "Opening https://apps.twitter.com/ to generate a twitter API tokens"
    driver.execute_script('''window.open("https://apps.twitter.com/","_blank");''')
    # Save the window opener (current window, do not mistaken with tab... not the same)
    window_twitterApps = driver.window_handles[2]
    # Put focus on current window which will, in fact, put focus on the current visible tab
    driver.switch_to_window(window_twitterApps)
    driver.find_elements_by_xpath("//*[contains(text(), 'Create New App')]")[0].click()

    driver.find_element_by_id("edit-name").send_keys(bot["full-name"] + "App")
    driver.find_element_by_id("edit-description").send_keys(bot["full-name"] + " is a good app")
    driver.find_element_by_id("edit-url").send_keys("http://twitter.com")
    driver.find_element_by_name("edit-tos-agreement").click()#checkbox click

    driver.find_element_by_id("edit-submit").submit()

    #generate tokens
    driver.find_elements_by_xpath("//*[contains(text(), 'Keys and Access Tokens')]")[0].click()
    myElem = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.ID, 'edit-submit-owner-token')))
    driver.find_element_by_id("edit-submit-owner-token").submit()

    # get the tokens
    myElem = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.ID, 'edit-token-actions')))

    consumerKey = driver.find_elements_by_xpath("//*[contains(text(), 'Consumer Key (API Key)')]/following-sibling::span")[0].text
    consumerSecret = driver.find_elements_by_xpath("//*[contains(text(), 'Consumer Secret (API Secret)')]/following-sibling::span")[0].text
    accessToken = driver.find_elements_by_xpath("//*[contains(text(), 'Access Token')]/following-sibling::span")[0].text
    accessTokenSecret = driver.find_elements_by_xpath("//*[contains(text(), 'Access Token Secret')]/following-sibling::span")[0].text

    botnetConfig["consumerKey"] = consumerKey
    botnetConfig["consumerSecret"] = consumerSecret
    botnetConfig["accessToken"] = accessToken
    botnetConfig["accessTokenSecret"] = accessTokenSecret

    with open('results.txt', 'w') as outfile:
        json.dump(botnetConfig, outfile)
botnetConfigEXAMPLE.json
    
{
    "phone-number": "123456789",
    "bots": [{
        "full-name": "bot1accountname",
        "password": "awesome password here 000"
    }]
}

json 更漂亮的配置

在圣战中站在一边

.prettierrc
{
  "semi": false,
  "singleQuote": true,
  "trailingComma": "all",
  "proseWrap": "always"
}