Skip to content

Instantly share code, notes, and snippets.

Avatar
☠️
screaming into the void

wilkie wilkie

☠️
screaming into the void
View GitHub Profile
@wilkie
wilkie / keybase.md
Created Sep 28, 2017
keybase proof
View keybase.md

Keybase proof

I hereby claim:

  • I am wilkie on github.
  • I am wilkie (https://keybase.io/wilkie) on keybase.
  • I have a public key whose fingerprint is 738A 1D5A FDF6 8DC2 0858 567D C2A2 2FFD 2510 664B

To claim this, I am signing this object:

View activitypub_discovery.md

For uri-identifiers that are non-webfinger identifiers, you'll see people say @wilkie.fyi and this will mean it does discovery by looking at that page and discovering via content negotiation and/or links. This is useful for people who are creating content on sites that doesn't implement webfinger, for instance a blogging or photo posting site. They'll add Link tags instead and use a full URI. Basically: it is eas(ier) to syndicate that content without having to own the domain, but hard to add something to .well-known.

I might be @example.org/wilkie or even, dare I say, @mastodon.social/@wilkie but it will still look like @wilkie to humans. The same methods you are using to disambiguate, but hide the details to human beings, will still work here.

To disambiguate, in AS2, mentions and "hashtags" etc can be parsed universally using tag:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "name": "A thank-you note",
@wilkie
wilkie / 0-description.md
Created Oct 26, 2014
This shows you how to handle simple, dynamic colored versions of svg files in ruby + sinatra.
View 0-description.md

This is an example of how to present a route in Sinatra that returns a colored version of an existing svg. This assumes the first line is the line, which is what inkscape produces. Just drop in any svg, and it will give you one where it is colored in with the given color.

/dynamic/foo.svg returns the normal image.

/dynamic/foo.svg?color=red gives you a red image.

/dynamic/foo.svg?hue=150&sat=50&light=50 gives you a slightly green version of the image.

/dynamic/foo.svg?hex=fff gives a white version of the image.

@wilkie
wilkie / scripts.rb
Last active Aug 29, 2015
Prints different things depending on language interpreter.
View scripts.rb
"<?php error_reporting(E_ALL ^ E_NOTICE); /* \
"; //; # ";
if ("00"==false)
console.log("Hello from JavaScript!");
else // # */
if ("0"==false)
printf("Hello from PHP!\n");
else
printf("Hello from Ruby!\n");
//; end;
@wilkie
wilkie / gist:10cf0cf60f371f680d30
Created May 1, 2014
Messing with unicode "constants"
View gist:10cf0cf60f371f680d30
# ruby 2.0.0p353
module Kernel
def const_set(sym, value)
if sym.to_s.match /^[^A-Z]/
@@__cool_constants ||= {}
@@__cool_constants[sym] = value
else
super(sym, value)
end
@wilkie
wilkie / example.rb
Created Apr 22, 2014
A dynamic natural language translation layer for ruby... an example:
View example.rb
require :spaES # <-- Select the stdlib locale
require 'stdlib' # <-- import the stdlib
# The above will be automatically done in practice, but it is just listed here
# as an illustration. This is because after this point, you need to use the term
# importar to import.
# As in: importar 'some-library'
# Only THIS file uses the function name table in español. Other files and existing libraries
# assuming the original or a different natural language are functionally unaffected. It is
@wilkie
wilkie / 00-description.md
Last active Aug 29, 2015
Disrupting ruby naming
View 00-description.md

Disrupting Ruby Naming

In the source files below, 'slash' means it is in a subdirectory. subdirectories are not allowed in gists. Find the source here

Let's say you, a native Spanish speaker, wanted to write some code and use a library, but you wanted it to be equally functional to a library that already exists, but have Spanish names. So far, our community has been focused on and expecting that everybody learn English. This is enforced in several places, but primarily in our programming languages. Let us be code librarians and ask ourselves: shouldn't we change that?

C

At first, I terrorized C's standard library by replacing the function names with those readable in Spanish. It was a good time.

View 20-things-where-you-should-shut-the-hell-up.md

http://www.daveramsey.com/blog/20-things-the-rich-do-every-day

I love lists! I especially love those that involve both a selection bias AND a confirmation bias!

I especially love the paragraph immediately after the list talking about how the Christian bible discusses how we should "live on less than we make" and instructs us that we should be "saving money and thereby building wealth". What?! God wants me to not be poor?! God should provide me with better health insurance options, a higher minimum wage, more inclusive workers' rights, and better, cheaper access to healthy food options.

  1. 70% of wealthy eat less than 300 junk food calories per day. 97% of poor people eat more than 300 junk food calories per day. 23% of wealthy gamble. 52% of poor people gamble.

The wealthy have better and more convenient access (through wealth and physical location) to large grocery stores.

@wilkie
wilkie / compile.sh
Last active Dec 21, 2015
Rust testing micro-framework based off of typical behavior testing frameworks that's a little rough around the edges, but a good example of the power of rust macros.
View compile.sh
rustc test.rs && ./test
@wilkie
wilkie / Gemfile
Created Jul 21, 2013
Using timezones in Ruby with simply the tzinfo database.
View Gemfile
source 'https://rubygems.org'
gem "tzinfo"
gem "tzinfo-data"
You can’t perform that action at this time.