Skip to content

Instantly share code, notes, and snippets.

From Mastadon post.

Working my way through the #rust book. Little confused by something in the modules section. Can't quite fit the whole thing in one toot, so here's a gist: <here>

Short version, useing nested modules. Does this allow access to ancestor modules or not?


In the modules section, the author refers back to the "guessing game" section and shows this:

= Othana =
[[/]] > [[/locations/]] > Othana
A: [[/locations/Sardis/]]
B: [[/locations/Pergamum/]]
C: [[/locations/Denilzi/]]
D: [[/locations/Laodicea/]]
E: [[/locations/Ephesus/]]
F: [[/locations/Philadelphia/]]
G: [[/locations/Smyrna/]]
@lukebergen
lukebergen / timeline.md
Last active May 13, 2022 04:00
Othana lore timeline

= Timeline =

[[/]] > [[/lore/]] > Timeline

The timeline of Othana is split into 3 distinct portions.

  • before-weapon (BW)
  • after-weapon (AW) (to pre-history ancients) / before-emergence (BE) (to modern people)
  • after-emergence (AE)

<---------- weapon ------------------ emergence -------------- modern day ------->

-------------
-- hotkeys --
-------------
hs.hotkey.bind({"alt", "ctrl"}, "space", function()
if (hs.spotify.isRunning()) then
hs.spotify.playpause()
end
end)
hs.hotkey.bind({"alt"}, "r", function()
@lukebergen
lukebergen / prepare-commit-msg
Last active December 22, 2021 20:07
Git commit message hook for reviewed clubhouse
#!/usr/bin/env ruby
# Automatically adds clubhouse id and link to commit messages based on branch name
file = ARGV[0]
branch_path = `git symbolic-ref -q HEAD`.split("\n")[0] # Somthing like refs/heads/myBranchName
branch_name = branch_path.split("/").last
chid = branch_name.split("-").last.gsub(/ch/i, '')
non_ammend = `head -n1 #{file}` == "\n"
<script type="text/javascript">
var src = '[%ImageFile%]' || '[%HostedCreativeURL%]'
window.parent.Reviewed.Gad.Sidewrap.render('%%CLICK_URL_UNESC%%[%ClickthroughURL%]', src, '[%BackgroundColor%]', '[%Title%]', '[%FullJSTag%]')
var p = [ "[%Thirdpartyimpressiontracker1%]", "[%Thirdpartyimpressiontracker2%]" ];
for (var i in p) {
if (p[i]) {
document.write('<img src="'+p[i]+'" height="1" width="1" style="visibility: hidden; position: absolute" />')
}
}
var t = [ '[%ScriptTagTrackerURL1%]', '[%ScriptTagTrackerURL2%]' ]
<script type="text/javascript">
var src = '[%ImageFile%]' || '[%HostedCreativeURL%]'
window.parent.Reviewed.Gad.Sidewrap.render('%%CLICK_URL_UNESC%%[%ClickthroughURL%]', src, '[%BackgroundColor%]', '[%Title%]')
var p = [ "[%Thirdpartyimpressiontracker1%]", "[%Thirdpartyimpressiontracker2%]" ];
for (var i in p) {
if (p[i]) {
document.write('<img src="'+p[i]+'" height="1" width="1" style="visibility: hidden; position: absolute" />')
}
}
var t = [ '[%ScriptTagTrackerURL1%]', '[%ScriptTagTrackerURL2%]' ]
function gistNope() {
throw "oh no. An error from gist.github.com";
}
@lukebergen
lukebergen / gup.html.erb
Last active August 3, 2018 14:13
Reviewed GUP code
<% if Rails.env.production? || Rails.env.staging? %>
<script src="https://login.gcion.com/resources/kit/js/jqnoconflict.common.min.js"></script>
<script>
// Some stuff makes it to omniture via a window.utag_data object
// Some stuff comes through an object that window.stateManager.getActivePageInfo() returns
window.utag_data = {};
var pageInfo = {};
window.stateManager = {
getActivePageInfo: function() {
let a0m = require("./server/auth0/mgmt");
let cli = a0m.getAuthenticationClient("password");
const AuthenticationClient = require('auth0').AuthenticationClient;
let cli = new AuthenticationClient({
domain: config.auth0config.domain,
clientId: config.auth0config[clientId],
clientSecret: config.secrets[clientSecret]
});