Skip to content

Instantly share code, notes, and snippets.

@rwmyers
rwmyers / RaindropTemplaterTemplate
Last active September 9, 2025 19:34
Raindrop / Obsidian Integration
<%*
let raindrop = tp.user.raindrop;
let collections = await raindrop.collections();
let collection = await tp.system.suggester((item) => item.title, collections);
let raindrops = await raindrop.raindrops(collection._id);
let drop = await tp.system.suggester((item) => item.title, raindrops);
drop = await raindrop.raindrop(drop._id);
let title = drop.title
let url = drop.link
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
@rwmyers
rwmyers / gist:4a6abb0d323fc8aed944
Created February 23, 2016 03:38
Math for a sample probability of x0
let x0 be the skill of team x as 0 (at positions 0 through n - 1)
let y be opponent 1 skill at x - 1 (or n - 1) if negative
let w be opponent 2 skill at (x + 1) % n
P(x0 | x0vy, wvx0) = P(x0) * P(x0vy, wvx0 | x0) / P(x0vY, wvx0)
= P(x0) * P(x0vy | x0) * P(wvx0 | x0) / P(x0vY, Wvx0)
= P(x0) * P(x0vy | x0) * P(wvx0 | x0) / (P(x0) * P(x0vy | x0) * P(wvx0 | x0)
+ P(x1) * P(x0vy | x1) * P(wvx1 | x1)
+ P(x2) * P(x2vy | x2) * P(wvx2 | x2)
+ P(x3) * P(x3vy | x3) * P(wvx3 | x3))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{% for post in posts %}
{% include "blog/includes/post.html" %}
<a href="http://russellmyers.com/blog/{{ post.slug }}#disqus_thread">Comments</a>
{% endfor %}
<script type="text/javascript">
var disqus_shortname = 'russellmyers';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
@rwmyers
rwmyers / comment_form.html
Created March 25, 2012 18:20
using recaptcha-client
<form action="/blog/add-comment/{{ post.slug }}" method="post">{% csrf_token %}
<script type="text/javascript"
src="http://www.google.com/recaptcha/api/challenge?k=<insert_public_key>">
</script>
<noscript>
<iframe src="http://www.google.com/recaptcha/api/noscript?k=<insert_public_key>"
height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field"
map <M-Right> :bn!<CR>
map <M-Left> :bp!<CR>
@rwmyers
rwmyers / index.html
Created March 5, 2012 04:22
Comment Django Model Object
{% with total=post.comment_set.all.count %}
<a href="/blog/{{ post.slug }}#comments">{{ total }} Comment{{ total|pluralize }}</a>
{% endwith %}
@rwmyers
rwmyers / models.py
Created March 1, 2012 04:46
AutoSlugField Model
from django.db import models
from autoslug import AutoSlugField
class Post(models.Model):
title = models.CharField(max_length=120, unique=True)
slug = AutoSlugField(populate_from='title', max_length=50, unique=True)
body = models.CharField()
posted = models.DateField(auto_now=True)
def __unicode__(self):
@rwmyers
rwmyers / autoslug install
Created March 1, 2012 03:50
install django-autoslug
sudo pip install django-autoslug