Skip to content

Instantly share code, notes, and snippets.

Avatar

Natalie Weizenbaum nex3

View GitHub Profile
View path.md

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@nex3
nex3 / drafting-a-cube-on-mtgo.md
Last active Jul 16, 2021
Drafting a custom cube on Magic Online
View drafting-a-cube-on-mtgo.md

We may all be quarantined at home, but I'm not going to let that get between me and my weekly cube draft night. I bought an entire copy of my cube on Magic Online so I could keep drafting and iterating on it even while we can't gather in person. Is it more of a pain than drafting a first-party cube? Without a doubt. But you can do it with your friends, at any time, using your cube list.

This document will walk drafters through the process of drafting their decks and acquiring them on Magic Online. It requires a host who owns all the cube cards in the first place and who knows how to trade them to the drafters--I've also written a guide to hosting a draft if that's what you're looking for!

This was written in May 2020, and some details of how things work may change in the future. Feel free to post updates in the comments, or even just fork this and modify it as necessary.

Table of Contents

View main.dart
// The total number of cards in the cube.
const C = 540;
// The number of piles to create.
const p = 8;
void main() {
var indices = [
for (var i = 0; i < p; i++) ...List.filled((C / p).floor(), i + 1),
// Randomly assign the last C % p numbers to piles without
View extend.md

How @extend Works

@akhleung is working on hcatlin/libsass and was wondering how @extend is implemented in the Ruby implementation of Sass. Rather than just tell him, I thought I'd write up a public document about it so anyone who's porting Sass or is just curious about how it works can see.

Note that this explanation is simplified in numerous ways. It's intended to explain the most complex parts of a basic correct @extend transformation, but it leaves out numerous details that will be important if full Sass compatibility

View sass-embedded.js
import * as sassEmbedded from 'sass-embedded';
// Spawns the embedded compiler, returns an object with the Node Sass API.
const sass = sassEmbedded.start();
sass.renderSync({data: 'a {b: c}'});
// Shuts down the embedded compiler, future calls to render et al now throw.
sass.close();
@nex3
nex3 / input.scss
Created Apr 9, 2021
Generated by SassMeister.com.
View input.scss
@use 'sass:string';
@mixin declare-toggle-var($variable, $toggle) {
@if string.slice($variable, 1, 2) != "--" {
@error "$variable: Must start with --, was \"#{$variable}\"."
}
$name: string.slice($variable, 3);
--#{$name}: initial;
--#{$name}--inverse: ;
@nex3
nex3 / input.scss
Created Feb 19, 2021
Generated by SassMeister.com.
View input.scss
@mixin some-component-a {
$component: ".some-component";
#{$component} {
display: inline;
}
body[lang='fr'] #{$component} div {
display: flex;
}
@nex3
nex3 / input.scss
Created Feb 18, 2021 — forked from umairhm/input.scss
Generated by SassMeister.com.
View input.scss
@mixin some-component-a {
.some-component {
display: inline;
body[lang='fr'] & div {
display: flex;
}
& div {
display: block;
@nex3
nex3 / input.scss
Created Feb 18, 2021
Generated by SassMeister.com.
View input.scss
.component-one {
location: outer;
.html[lang=fr] & {
location: inner;
}
}
@nex3
nex3 / input.scss
Created Feb 11, 2021
Generated by SassMeister.com.
View input.scss
.outer {
prop1: value;
.inner {
x: y;
}
prop2: value;
}