Skip to content

Instantly share code, notes, and snippets.

Rasmus rsms

Block or report user

Report or block rsms

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rsms
rsms / 00-readme.md
Created May 12, 2020
TensorFlow-GPU on a dedicated remote PC, using a Mac for development
View 00-readme.md

My random notes on the adventure of developing with TensorFlow on a Mac, running calculations on a NVIDIA GPU in a separate PC. Your miles may vary.

@rsms
rsms / chardiff.sh
Created Mar 9, 2020
Terribly hacky script for generating GIFs of font changes over time
View chardiff.sh
#!/bin/bash -e
#
# Generate GIFs of font changes over time
#
# HERE BE DRAGONS!
# This is a hack of a script. It won't just run for you. Edit it to suit your system and needs.
#
pushd "$(dirname "$0")" >/dev/null
chardiffdir=$PWD
pushd "../.." >/dev/null
View pdf-to-svg.md

Converting PDF → SVG

Surprisingly complicated. Figma supports SVG → PDF but not the other way around. Sketch supports PDF → SVG with some bugs (often vector shape overlaps are incorrect.)

dawbarton/pdf2svg looks like an interesting project that could be compiled as WASM but it is itself poinsoned by GNU GPL license. Plus, it depends on a huge amount of (also GPL-licensed) code in the form of Poppler and Cairo.

View kauai.md

Kauai Juice Co. (Kapaa) kauaijuiceco.com Awesome ladies, awesome kombucha on tap, awesome juices and mylks (almond usually), and nice design. It's behind Java Kai, so not right on the main street. Went there a ton. Rainbow Living Foods (Kapaa) http://www.yelp.com/biz/rainbow-living-foods-kapaa

If you dig fresh, and yes, raw, foods, this place is the jam. Super good. Art Cafe Hemingway (Kapaa) http://www.yelp.com/biz/art-café-hemingway-kapaa-2

Excellent breakfast in a beautiful chill setting. Gluten-free options. Java Kai (Kapaa) http://www.yelp.com/biz/java-kai-kapaa

@rsms
rsms / macos-NSUserDictionaryReplacementItems.plist
Created Mar 5, 2020
defaults read -g NSUserDictionaryReplacementItems
View macos-NSUserDictionaryReplacementItems.plist
(
{
on = 1;
replace = kbmul;
with = "\\U00d7";
},
{
on = 1;
replace = kbrarr;
with = "\\U2192";
View rsms-dark-mono.sublime-color-scheme
{
"name": "rsms dark v2 mono",
"author": "rsms",
"variables": {
"red": "hsl(5, 0%, 50%)",
"orange": "hsl(27, 0%, 50%)",
"yellow": "hsl(60, 0%, 50%)",
"green": "hsl(150, 0%, 43%)",
"cyan": "hsl(180, 0%, 50%)",
"blue": "hsl(210, 0%, 50%)",
View wasm1-bin.md

Binary Encoding

Note: This document is no longer being updated. Please see the normative documentation.

This document describes the portable binary encoding of the WebAssembly modules.

The binary encoding is a dense representation of module information that enables small files, fast decoding, and reduced memory usage. See the rationale document for more detail.

View ascii-utf8-table.c
static unsigned char map[256] = {
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/* 0x00 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // <CTRL> ...
/* 0x10 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // <CTRL> ...
/* 0x20 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // ! " # $ % & ' ( ) * + , - . /
/* 0x30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
/* 0x40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // @ A B C D E F G H I J K L M N O
/* 0x50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // P Q R S T U V W X Y Z [ \ ] ^ _
/* 0x60 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // ` a b c d e f g h i j k l m n o
/* 0x70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // p q r s t u v w x y z { | } ~ <DEL>
@rsms
rsms / fig-thumbnails.js
Created Nov 18, 2019
Script to fetch thumbnails of figma files
View fig-thumbnails.js
// 1. Make sure you have imagemagick installed (`brew install imagemagick` on macos)
// 2. Visit https://www.figma.com/developers/api#authentication and click "Get personal access token"
// 3. Add your file links below, replacing the example links
// 4. Run with `FIGMA_API_TOKEN=YOUR_TOKEN_FROM_STEP_2_HERE node fig-thumbnails.js`
// [ host:string, filekey:string ][]
const fileKeys = `
https://www.figma.com/file/FILEKEY/
https://staging.figma.com/file/FILEKEY/
https://www.figma.com/file/FILEKEY/
View chromium-v8-firefox-regexp-bug.md

Subject

RegExp that never finishes; hangs with 100% CPU. Easy repro

Repro steps

  1. Run the attached script in V8/Chrome
  2. Sample the process
  3. Notice how it's stuck in v8::internal::NativeRegExpMacroAssembler::Execute

Expected outcome

The code to not take forever to finish

You can’t perform that action at this time.