Common code statements in different languages for quick reference and comparison: Java, JavaScript, Kotlin, Objective-C, Python, Ruby, Scala, Swift.
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
/** | |
* This is an example of a basic node.js script that performs | |
* the Client Credentials oAuth2 flow to authenticate against | |
* the Spotify Accounts. | |
* | |
* For more information, read | |
* https://developer.spotify.com/web-api/authorization-guide/#client_credentials_flow | |
*/ | |
var request = require('request'); // "Request" library |
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
fade("#title", "Привет!") | |
fade("#text1", "Вот " + link("песня", "https://disk.yandex.ru") + " я написал для тебя") | |
fade("#text2", "Пожалуйста скажи как тебе)") | |
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
$('#main-button').click(); // click the "MAIN" button (scrolls up) | |
setTimeout(changeTexts, 1000); // run after 1 second (to give time to scrolling) | |
function changeTexts() { | |
fade("#title", "Practice coding") | |
const action = random(["try", "run", "execute", "modify"]) | |
const js = link("JavaScript", "https://developer.mozilla.org/docs/Web/JavaScript") | |
fade("#text1", "You can " + action + " the " + js + " code below") | |
const functions = join(["fade", "join", "link", "random"]); |
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
let version = "v0.5.12 token color"; | |
$("#main").css({padding: "0.5em"}); | |
//$('#main-button').click(); | |
let tokens = [ | |
'+1', | |
0, 0, -1, -1, -1, -2, -2, | |
-3, -4, | |
"Skull", "Skull", "Cape", |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
#map { | |
height: 400px; | |
width: 100%; | |
} | |
#searchTextField { |
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
// This code is displays a counter above. | |
// The code is transpiled with Babel and run with eval(). | |
const { useState } = React; // imports don't work here | |
function Counter() { | |
const [count, setCount] = useState(0); | |
return ( | |
<div style={{margin: 20}}> |
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 React from 'react' // imports don't work here | |
const tokens = [ | |
"+1", 0, 0, -1, -1, -1, | |
-2, -2, -3, -4, | |
"💀", "💀", "🧙", "🦑", "🌟" | |
]; | |
function diceMessageGenerator(value) { | |
switch (value) { |
OlderNewer