modifications from addition of toggle theme script

This commit is contained in:
Osinachi Chukwujama 2022-12-24 19:49:13 +01:00
parent bfcdd7d3b3
commit c0f0def03f
83 changed files with 3486 additions and 82 deletions

43
public/404.html generated
View File

@ -11,7 +11,48 @@
<p>Sorry, we couldn't find that! Check out the <a href="./">home page</a>?</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/arrays generated
View File

@ -188,7 +188,48 @@ when printed with <code>fmt.Println</code>.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/atomic-counters generated
View File

@ -226,7 +226,48 @@ state.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/base64-encoding generated
View File

@ -182,7 +182,48 @@ but they both decode to the original string as desired.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -144,7 +144,48 @@ concurrent receive.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -136,7 +136,48 @@ receive on this channel.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -175,7 +175,48 @@ started.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/channels generated
View File

@ -160,7 +160,48 @@ message without having to use any other synchronization.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -186,7 +186,48 @@ example: <code>range</code> over channels.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/closures generated
View File

@ -181,7 +181,48 @@ recursion.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -161,7 +161,48 @@ with flags.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -297,7 +297,48 @@ and show the help text again.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -251,7 +251,48 @@ way to parameterize programs.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/constants generated
View File

@ -174,7 +174,48 @@ assignment or function call. For example, here
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/context generated
View File

@ -196,7 +196,48 @@ cancellation.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/defer generated
View File

@ -200,7 +200,48 @@ after being written.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/directories generated
View File

@ -338,7 +338,48 @@ recursively by <code>filepath.Walk</code>.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/embed-directive generated
View File

@ -201,7 +201,48 @@ this example can only be run on your local machine.)</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -177,7 +177,48 @@ program picks that value up.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/epoch generated
View File

@ -161,7 +161,48 @@ parsing and formatting.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/errors generated
View File

@ -287,7 +287,48 @@ on the Go blog for more on error handling.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -195,7 +195,48 @@ processes covers most use cases for <code>fork</code>.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/exit generated
View File

@ -161,7 +161,48 @@ the status in the terminal.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/file-paths generated
View File

@ -240,7 +240,48 @@ be made relative to base.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/for generated
View File

@ -186,7 +186,48 @@ structures.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/functions generated
View File

@ -183,7 +183,48 @@ multiple return values, which we&rsquo;ll look at next.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/generics generated
View File

@ -238,7 +238,48 @@ automatically.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/goroutines generated
View File

@ -199,7 +199,48 @@ concurrent Go programs: channels.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/hello-world generated
View File

@ -126,7 +126,48 @@ learn more about the language.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/http-client generated
View File

@ -160,7 +160,48 @@ settings.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/http-server generated
View File

@ -201,7 +201,48 @@ router we&rsquo;ve just set up.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/if-else generated
View File

@ -175,7 +175,48 @@ for basic conditions.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/index.html generated
View File

@ -190,7 +190,48 @@
</ul>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/interfaces generated
View File

@ -227,7 +227,48 @@ these structs as arguments to <code>measure</code>.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/json generated
View File

@ -403,7 +403,48 @@ for more.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/line-filters generated
View File

@ -194,7 +194,48 @@ lowercase lines.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/maps generated
View File

@ -224,7 +224,48 @@ printed with <code>fmt.Println</code>.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/methods generated
View File

@ -187,7 +187,48 @@ naming related sets of methods: interfaces.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -157,7 +157,48 @@ feature of Go functions; we&rsquo;ll look at this next.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/mutexes generated
View File

@ -241,7 +241,48 @@ management task using only goroutines and channels.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -167,7 +167,48 @@ on both <code>messages</code> and <code>signals</code>.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/number-parsing generated
View File

@ -205,7 +205,48 @@ bits.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/panic generated
View File

@ -176,7 +176,48 @@ to use error-indicating return values wherever possible.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/pointers generated
View File

@ -184,7 +184,48 @@ the memory address for that variable.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/random-numbers generated
View File

@ -226,7 +226,48 @@ that Go can provide.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/range generated
View File

@ -193,7 +193,48 @@ details.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -145,7 +145,48 @@ values be received.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/rate-limiting generated
View File

@ -252,7 +252,48 @@ then serve the remaining 2 with ~200ms delays each.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/reading-files generated
View File

@ -277,7 +277,48 @@ be scheduled immediately after <code>Open</code>ing with
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/recover generated
View File

@ -186,7 +186,48 @@ panic and resumes in the deferred closure.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/recursion generated
View File

@ -172,7 +172,48 @@ knows which function to call with <code>fib</code> here.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -334,7 +334,48 @@ the <a href="https://pkg.go.dev/regexp"><code>regexp</code></a> package docs.</p
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/select generated
View File

@ -174,7 +174,48 @@ concurrently.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/sha256-hashes generated
View File

@ -190,7 +190,48 @@ you should carefully research
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/signals generated
View File

@ -204,7 +204,48 @@ causing the program to print <code>interrupt</code> and then exit.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

42
public/site.js generated
View File

@ -15,3 +15,45 @@ var clipboard = new Clipboard('.copy', {
return codeLines.filter(function(cL) { return cL != '' }).join("\n").replace(/\n$/, '');
}
});
/**
* Code for theme switching
*/
// var themeButton = document.getElementById('theme-button');
// var body = document.getElementsByTagName('body')[0];
// function activateDarkTheme(){
// body.style.color = "#ffffffeb"
// body.style.backgroundColor = "#1a202c"
// localStorage.setItem('theme', 'dark')
// }
// function activateLightTheme(){
// body.style.color = "#252519"
// body.style.backgroundColor = "white"
// localStorage.setItem('theme', 'light')
// }
// if (localStorage.getItem('theme') === 'light') {
// activateLightTheme()
// } else if (localStorage.getItem('theme') === 'dark'){
// activateDarkTheme()
// }
// themeButton.onclick = function(){
// if (localStorage.getItem('theme') === 'dark'){
// activateLightTheme()
// } else if (localStorage.getItem('theme') === 'light'){
// activateDarkTheme()
// } else {
// if (body.style.color === "white"){
// activateDarkTheme()
// } else {
// activateLightTheme()
// }
// }
// }

43
public/slices generated
View File

@ -300,7 +300,48 @@ Go&rsquo;s other key builtin data structure: maps.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/sorting generated
View File

@ -152,7 +152,48 @@ slices and <code>true</code> as the result of our <code>AreSorted</code> test.</
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -170,7 +170,48 @@ functions.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -274,7 +274,48 @@ an error message and non-zero return code.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -304,7 +304,48 @@ program.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -447,7 +447,48 @@ and returns a string without printing it anywhere.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -154,7 +154,48 @@ package docs.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -274,7 +274,48 @@ can compare a <code>rune</code> value to a rune literal directly.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -238,7 +238,48 @@ we see that a <code>container</code> now implements the
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/structs generated
View File

@ -257,7 +257,48 @@ pointers are automatically dereferenced.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/switch generated
View File

@ -194,7 +194,48 @@ type corresponding to its clause.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -230,7 +230,48 @@ prefixing them with our temporary directory.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -276,7 +276,48 @@ benchmark function names with a regexp.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/text-templates generated
View File

@ -265,7 +265,48 @@ the range block <code>{{.}}</code> is set to the current item of the iteration.<
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/tickers generated
View File

@ -162,7 +162,48 @@ before we stop it.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/time generated
View File

@ -261,7 +261,48 @@ the Unix epoch.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -195,7 +195,48 @@ explaining the parsing problem.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/timeouts generated
View File

@ -173,7 +173,48 @@ out and the second succeeding.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/timers generated
View File

@ -176,7 +176,48 @@ a chance to fire.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/url-parsing generated
View File

@ -227,7 +227,48 @@ pieces that we extracted.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/values generated
View File

@ -143,7 +143,48 @@ basic examples.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/variables generated
View File

@ -175,7 +175,48 @@ This syntax is only available inside functions.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

View File

@ -177,7 +177,48 @@ to form closures, which we&rsquo;ll look at next.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/waitgroups generated
View File

@ -243,7 +243,48 @@ is likely to be different for each invocation.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/worker-pools generated
View File

@ -214,7 +214,48 @@ there are 3 workers operating concurrently.</p>
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/writing-files generated
View File

@ -277,7 +277,48 @@ we&rsquo;ve just seen to the <code>stdin</code> and <code>stdout</code> streams.
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>

43
public/xml generated
View File

@ -268,7 +268,48 @@ to nest all <code>plant</code>s under <code>&lt;parent&gt;&lt;child&gt;...</code
<p class="footer">
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a>
<script>
window.onload = function() {
function styleAllTags(tag, style, value){
document.querySelectorAll(tag).forEach((tag) => {
tag.style[style] = value
})
}
var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0];
function activateTheme(theme) {
if (theme === 'dark') {
body.style.color = "#ffffffeb";
body.style.backgroundColor = "#1a202c";
styleAllTags('a', 'color', '#ffffffeb')
styleAllTags('td.code', 'background', '#333333')
styleAllTags('td.code.empty', 'background', '#1a202c')
} else {
body.style.color = "#252519";
body.style.backgroundColor = "white";
styleAllTags('a', 'color', '#252519')
styleAllTags('td.code', 'background', '#f0f0f0')
styleAllTags('td.code.empty', 'background', 'white')
}
localStorage.setItem('theme', theme);
}
var currentTheme = localStorage.getItem('theme');
if (currentTheme === 'light' || currentTheme === 'dark') {
activateTheme(currentTheme);
} else {
activateTheme('light');
}
themeButton.onclick = function() {
var newTheme = localStorage.getItem('theme') === 'dark' ? 'light' : 'dark';
activateTheme(newTheme);
}
}
</script>
by <a href="https://markmcgranaghan.com">Mark McGranaghan</a> and <a href="https://eli.thegreenplace.net">Eli Bendersky</a> | <a href="https://github.com/mmcgrana/gobyexample">source</a> | <a href="https://github.com/mmcgrana/gobyexample#license">license</a> | <button id="theme-button">Toggle theme</button>
</p>
</div>