modifications from addition of toggle theme script
This commit is contained in:
parent
bfcdd7d3b3
commit
c0f0def03f
43
public/404.html
generated
43
public/404.html
generated
@ -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
43
public/arrays
generated
@ -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
43
public/atomic-counters
generated
@ -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
43
public/base64-encoding
generated
@ -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>
|
||||
|
43
public/channel-buffering
generated
43
public/channel-buffering
generated
@ -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>
|
||||
|
43
public/channel-directions
generated
43
public/channel-directions
generated
@ -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>
|
||||
|
43
public/channel-synchronization
generated
43
public/channel-synchronization
generated
@ -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
43
public/channels
generated
@ -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>
|
||||
|
43
public/closing-channels
generated
43
public/closing-channels
generated
@ -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
43
public/closures
generated
@ -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>
|
||||
|
43
public/command-line-arguments
generated
43
public/command-line-arguments
generated
@ -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>
|
||||
|
43
public/command-line-flags
generated
43
public/command-line-flags
generated
@ -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>
|
||||
|
43
public/command-line-subcommands
generated
43
public/command-line-subcommands
generated
@ -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
43
public/constants
generated
@ -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
43
public/context
generated
@ -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
43
public/defer
generated
@ -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
43
public/directories
generated
@ -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
43
public/embed-directive
generated
@ -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>
|
||||
|
43
public/environment-variables
generated
43
public/environment-variables
generated
@ -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
43
public/epoch
generated
@ -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
43
public/errors
generated
@ -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>
|
||||
|
43
public/execing-processes
generated
43
public/execing-processes
generated
@ -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
43
public/exit
generated
@ -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
43
public/file-paths
generated
@ -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
43
public/for
generated
@ -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
43
public/functions
generated
@ -183,7 +183,48 @@ multiple return values, which we’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
43
public/generics
generated
@ -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
43
public/goroutines
generated
@ -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
43
public/hello-world
generated
@ -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
43
public/http-client
generated
@ -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
43
public/http-server
generated
@ -201,7 +201,48 @@ router we’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
43
public/if-else
generated
@ -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
43
public/index.html
generated
@ -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
43
public/interfaces
generated
@ -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
43
public/json
generated
@ -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
43
public/line-filters
generated
@ -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
43
public/maps
generated
@ -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
43
public/methods
generated
@ -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>
|
||||
|
43
public/multiple-return-values
generated
43
public/multiple-return-values
generated
@ -157,7 +157,48 @@ feature of Go functions; we’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
43
public/mutexes
generated
@ -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>
|
||||
|
43
public/non-blocking-channel-operations
generated
43
public/non-blocking-channel-operations
generated
@ -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
43
public/number-parsing
generated
@ -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
43
public/panic
generated
@ -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
43
public/pointers
generated
@ -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
43
public/random-numbers
generated
@ -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
43
public/range
generated
@ -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>
|
||||
|
43
public/range-over-channels
generated
43
public/range-over-channels
generated
@ -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
43
public/rate-limiting
generated
@ -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
43
public/reading-files
generated
@ -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
43
public/recover
generated
@ -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
43
public/recursion
generated
@ -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>
|
||||
|
43
public/regular-expressions
generated
43
public/regular-expressions
generated
@ -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
43
public/select
generated
@ -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
43
public/sha256-hashes
generated
@ -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
43
public/signals
generated
@ -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
42
public/site.js
generated
@ -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
43
public/slices
generated
@ -300,7 +300,48 @@ Go’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
43
public/sorting
generated
@ -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>
|
||||
|
43
public/sorting-by-functions
generated
43
public/sorting-by-functions
generated
@ -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>
|
||||
|
43
public/spawning-processes
generated
43
public/spawning-processes
generated
@ -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>
|
||||
|
43
public/stateful-goroutines
generated
43
public/stateful-goroutines
generated
@ -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>
|
||||
|
43
public/string-formatting
generated
43
public/string-formatting
generated
@ -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>
|
||||
|
43
public/string-functions
generated
43
public/string-functions
generated
@ -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>
|
||||
|
43
public/strings-and-runes
generated
43
public/strings-and-runes
generated
@ -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>
|
||||
|
43
public/struct-embedding
generated
43
public/struct-embedding
generated
@ -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
43
public/structs
generated
@ -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
43
public/switch
generated
@ -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>
|
||||
|
43
public/temporary-files-and-directories
generated
43
public/temporary-files-and-directories
generated
@ -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>
|
||||
|
43
public/testing-and-benchmarking
generated
43
public/testing-and-benchmarking
generated
@ -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
43
public/text-templates
generated
@ -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
43
public/tickers
generated
@ -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
43
public/time
generated
@ -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>
|
||||
|
43
public/time-formatting-parsing
generated
43
public/time-formatting-parsing
generated
@ -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
43
public/timeouts
generated
@ -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
43
public/timers
generated
@ -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
43
public/url-parsing
generated
@ -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
43
public/values
generated
@ -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
43
public/variables
generated
@ -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>
|
||||
|
43
public/variadic-functions
generated
43
public/variadic-functions
generated
@ -177,7 +177,48 @@ to form closures, which we’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
43
public/waitgroups
generated
@ -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
43
public/worker-pools
generated
@ -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
43
public/writing-files
generated
@ -277,7 +277,48 @@ we’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
43
public/xml
generated
@ -268,7 +268,48 @@ to nest all <code>plant</code>s under <code><parent><child>...</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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user