EDITOR
Editor Blocks
Code editor: multi-language
7min
our code editor is where you can show off code examples that can be easily copied you can add multiple tabs using the same language and use drag and drop to reorganize tabs when you add a new tab, you can also change the name to something like a file, e g , main js see our example main js fetch("https //api cakes com", { "method" "get", "headers" { "accept" "application/json" } }) then(response => { console log(response); }) catch(err => { console error(err); }); // we can use channels to synchronize execution // across goroutines here's an example of using a // blocking receive to wait for a goroutine to finish // when waiting for multiple goroutines to finish, // you may prefer to use a \[waitgroup]\(waitgroups) package main import "fmt" import "time" // this is the function we'll run in a goroutine the // `done` channel will be used to notify another // goroutine that this function's work is done func worker(done chan bool) { fmt print("working ") time sleep(time second) fmt println("done") // send a value to notify that we're done done < true } func main() { // start a worker goroutine, giving it the channel to // notify on done = make(chan bool, 1) go worker(done) // block until we receive a notification from the // worker on the channel < done } \# python3 program to demonstrate \# the use of sample() function \# import random import random \# prints list of random items of \# length 3 from the given list list1 = \[1, 2, 3, 4, 5, 6] print("with list ", random sample(list1, 3)) \# prints list of random items of \# length 4 from the given string string = "geeksforgeeks" print("with string ", random sample(string, 4)) \# prints list of random items of \# length 4 from the given tuple tuple1 = ("ankit", "geeks", "computer", "science", "portal", "scientist", "btech") print("with tuple ", random sample(tuple1, 4)) \# prints list of random items of \# length 3 from the given set set1 = {"a", "b", "c", "d", "e"} print("with set ", random sample(set1, 3)) macos \<?php $name = "quincy"; echo "hi! my name is " $name "\<br>"; echo "hi! my name is " $name "\<br>"; echo "hi! my name is " $name "\<br>"; ?>/ c# program to check whether the entered year is a leap year or not / using system; using system collections generic; using system linq; using system text; namespace program { class leapyear { static void main(string\[] args) { leapyear obj = new leapyear(); obj readdata(); obj leap(); } int y; public void readdata() { console writeline("enter the year in four digits "); y = convert toint32(console readline()); } public void leap() { if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) { console writeline("{0} is a leap year", y); } else { console writeline("{0} is not a leap year", y); } console readline(); } } }hello world! this is text markdown code block with a single tab var http = require('http'); http createserver(function (req, res) { res writehead(200, {'content type' 'text/plain'}); res end('hello world!'); }) listen(8080); use the following markdown to generate a code block with a single code example \## code block ```nodejs var http = require('http'); http createserver(function (req, res) { res writehead(200, {'content type' 'text/plain'}); res end('hello world!'); }) listen(8080); ``` code blocks without language // code block not specified// code block not specified// code block not specified use the following markdown to generate a code block without specifying the language \## code blocks \ codeblocktabs ``` // code block not specified ``` ``` // code block not specified ``` ``` // code block not specified ``` \ code editor with multiple tabs // php is the best // and java too// demo go// demo js use the following markdown to generate a code block with multiple tabs \## demo code blocks \ codeblocktabs ```php // php is the best ``` ```java // and java too ``` ```go // demo go ``` ```javascript // demo js ``` \ find other blocks discover new ways and blocks to create stunning and functional documentation pages editor blocks docid 6b0vtqtvunmp93e szq2p need help? ⬇️ use the blue chat bubble from bottom right corner or try ai chat (from search box) for quick answers your opinion matters use the below feedback form, anonymously or ask a question in q\&a section and our team or ai will give you a solution
🤔
Have a question?
Our super-smart AI,knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.