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 routesFilesPlugin = { | |
name: 'route-files', | |
buildStart: async (options) => { | |
console.log('Generating routeModules.js'); | |
const routesDir = path.resolve(__dirname, 'src/components/routes'); | |
const routeFiles = fs.readdirSync(routesDir); | |
const routesString = routeFiles.map((filename) => { |
This is how you'd call the function:
Call(Function("GetNestedDocument"), [Ref(Collection("SomeCollection"), "264260207986606612"), 0, 3])
Parameters:
- A
Ref
of a document. - Current depth. Since AFAIK we cannot have default values in
Lambda
we need to pass0
for the first level. - Max depth. The max number of levels the recursive function will go.
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 router = require('./router'); | |
router.setRoutes([ | |
{ | |
path: '/ping', | |
method: 'GET', | |
handler: ping | |
}, | |
{ | |
path: '/hello/:name', |
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
class AppDelegate: NSObject, NSApplicationDelegate { | |
func applicationDidFinishLaunching(_ aNotification: Notification) { | |
NSAppleEventManager.shared().setEventHandler(self, andSelector: #selector(self.handleGetURLEvent(event:replyEvent:)), forEventClass: AEEventClass(kInternetEventClass), andEventID: AEEventID(kAEGetURL)) | |
} | |
@objc func handleGetURLEvent(event: NSAppleEventDescriptor, replyEvent: NSAppleEventDescriptor) { | |
let urlString = event.paramDescriptor(forKeyword: AEKeyword(keyDirectObject))?.stringValue! | |
let url = URL(string: urlString!)! | |
debugPrint(url); | |
} |
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 https = require('https'); | |
const fs = require('fs'); | |
const writeStream = fs.createWriteStream("./log.xls"); | |
let bytes = 0; | |
https.get('https://edge.mixlr.com/channel/udesp', (resp) => { | |
resp.on('data', (buffer) => { | |
bytes += buffer.length; | |
}); |
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
<div id="my-thing-template"> | |
<div class="my-thing" @click='edit'> | |
<div v-if="!editing">{{thing}}</div> | |
<div v-else> | |
<form @submit.prevent="onSubmit"> | |
<input type="text" v-model="form.title"> | |
<button type="submit">Submit</button> | |
<button @click="cancelEdit">Cancel</button> | |
</form> | |
</div> |
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
<div id="fruits"> | |
<my-fruit v-for="fruit in fruits" :fruit-name="fruit"></my-fruit> | |
</div> | |
<script> | |
var component = new Vue({ | |
el: '#fruits', | |
data: { | |
fruits: ['Apple', 'Banana', 'Mango'] | |
} |
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
{% include components/fruit.html %} |
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
<div id="fruit-template" class="vue-template"> | |
<div class="fruit"> | |
<h3>{{fruitName}}</h3> | |
</div> | |
</div> | |
<script> | |
Vue.component('my-fruit', { | |
template: '#fruit-template', | |
props: ['fruit-name'] |