Skip to content

Instantly share code, notes, and snippets.

View mbarriault's full-sized avatar

Maya Barriault mbarriault

  • Newfoundland, Canada
View GitHub Profile
let scaledImage: UIImage
do {
UIGraphicsBeginImageContextWithOptions(size, false, 0.0)
defer {
UIGraphicsEndImageContext()
}
// Fill background
UIColor.blackColor().setFill(); UIRectFill(CGRect(origin: .zero, size: size))
// Draw scaled image
# This is a list of sizes for all the race-token-sized categories
# v-Behemoths v-Cultists(1) v-Gnomes v-Homunculi v-Liches v-Ogres v-ShadowMimes v-Tritons v-OtherPowers
# v-Monsters v-HordesOf v-Dwarves v-Ghouls v-Gypsies v-Igors v-Leprechauns(17) v-Orcs v-Ratmen v-Skeletons v-WhiteLadies
set Nsp [lsort -decreasing -integer {14 22 14 12 2 15 14 10 9 8 11 18 9 10 11 11 11 11 11 15 10 15 12 16 10 11 10 12 12 15 10 10 16 9 11 13 12 10 11 20 18 12 11 10 7 11 10 10}];
# ^-LostTribes ^-Barbarians ^-Fauns ^-Giants ^Halflings(2) ^-Kobold ^-Lizardmen ^-Pixies ^-Shrooms ^-Spiderines ^-Wizards
# ^-Ghosts ^-Drow ^-Flames ^-Goblins ^-Humans ^-Kraken ^-Mudmen ^-Priestesses ^-Sorcerers ^-Will-O-Wisps
# ^-Ama
extern(C++) {
interface Foo(int i) {
void bar();
}
Foo!i newFoo(int i)();
}
void main() {
Foo!3 foo = newFoo!3();
foo.bar();
template<int i>
class Foo {
public:
virtual void bar() {
}
};
template<int i>
Foo<i>* newFoo() {
Foo<i>* foo = new Foo<i>();
extern (C++) {
interface Foo {
void bar();
}
Foo newFoo();
}
void main() {
Foo foo = newFoo();
foo.bar();
class Foo {
public:
virtual void bar() {
// do something
}
};
static Foo* newFoo() {
Foo* foo = new Foo();
return foo;