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 socket | |
import sys | |
""" based on https://pymotw.com/3/socket/tcp.html | |
modified by Adrian Jost""" | |
# Create a TCP/IP socket | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
# Bind the socket to the port |
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
/* | |
* Created by Adrian Jost | |
* Feel free to use, but please credit me | |
* | |
* Start the game by calling `ttt()` | |
*/ | |
function drawBoard(round, board){ | |
console.group(`Score after round ${round}`); | |
console.log(" "); | |
console.log(' ' + (board["7"] || '7 ') + " | " + (board["8"] || ' 8 ') + " | " + (board["9"] || ' 9 ')); |
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
// Copyright (C) 2019 Adrian Jost | |
// This code is licensed under MIT license (see https://tldrlegal.com/license/mit-license for details) | |
const fs = require("fs"); | |
const readFile = filename => { | |
return new Promise((resolve, reject) => { | |
fs.readFile(filename, "utf8", function(err, data) { | |
if (err) { | |
reject(err); |
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 traverseFiles = async (item) => { | |
if(item.isFile){ | |
return { file: item.file(), path: item.fullPath }; | |
}else if(item.isDirectory){ | |
const entries = await new Promise(resolve => item.createReader().readEntries(resolve)); | |
const files = await Promise.all(entries.map(traverseFiles)); | |
return { path: item.fullPath, files }; | |
} | |
} |
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
<script> | |
// Cool way to render Vue components from HTML Strings | |
// https://medium.com/haiiro-io/compile-markdown-as-vue-template-on-nuxt-js-1c606c15731c | |
import VueWithCompiler from "vue/dist/vue.esm"; | |
export default { | |
props: { | |
html: { | |
type: String, | |
default: "", | |
}, |
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
<script> | |
import RenderHtml from "./RenderHtml.vue"; | |
import FancyButton from "@components/FancyButton.vue"; | |
export default { | |
components: { | |
FancyButton, | |
}, | |
...RenderHtml, | |
}; | |
</script> |
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 path = require("path"); | |
const aliases = { | |
// required to not break nuxt | |
"@": "src", | |
"@@": ".", | |
// custom aliases | |
"@components": "src/components", | |
} |
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 glob = require("glob"); | |
const path = require("path"); | |
// returns a list of all filepaths in a given directory | |
const readDirRecursiveSync = dir => { | |
return glob.sync(`${dir}/**/*.*`); | |
}; | |
const getThemeAliases = (dir, theme) => { | |
const themeFilesDir = `src/themes/${theme}/${dir}`; |
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
name: Sync | |
'on': | |
schedule: | |
- cron: '0 3 * * *' | |
push: | |
branches: | |
- master | |
jobs: | |
files: | |
name: Files |
OlderNewer