Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Rampersad ryanmr

View GitHub Profile
View test.md

this is a header

<picture>
  <source srcset="/large.jpg"
          media="(prefers-color-scheme: dark)">
  <source srcset="/small.jpg"
          media="(prefers-color-scheme: light)">
  <img src="/large.jpg" />
View yml.js
const YAML = require("yaml");
const data = {
overview: {
str: "this is a string",
num: 5,
},
};
const yml = YAML.stringify(data, {
View convertvideo.sh
#!/bin/bash
# A sample Bash script, by Ryan
DT=$(date '+%Y-%m-%d-%H%M%S')
OUTPUT_NAME="converted-$DT.mp4"
OUTPUT_FOLDER=$(dirname "$1")
OUTPUT_PATH="$OUTPUT_FOLDER/$OUTPUT_NAME"
echo "converting input video $1 to $OUTPUT_NAME mp4"
View Super Save.py
from datetime import date
import random
import sublime_plugin
def callback(s):
print('saved: ', s)
class SuperSaveCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.insert(edit, 0, "saving all the files")
View snowpack-app-with-tailwind.md

Following the steps documented to get tailwind to work with snowpack, nothing happens.

My script uses npm-run-all as an intermediate parallel or sequential step to handle tailwind.

  "scripts": {
    "tailwind:start": "postcss ./public/tailwind.css -o ./public/tailwind.include.css -w",
    "tailwind:build": "postcss ./public/tailwind.css -o ./public/tailwind.include.css --env production",
    "snowpack:start": "snowpack dev",
 "snowpack:build": "snowpack build",
View gist:e21b42cc106bdb82830845bf63be45d2
select elements inside of shadow root - Google Search
Better History - Chrome Web Store
Better History - Chrome Web Store
chrome better history - Google Search
make pr draft pr - Google Search
run stage if azure piepelines - Google Search
azure pipelines only dev - Google Search
github foot notes - Google Search
macos get number of windows open - Google Search
strapi - Google Search
View mapbox-change-font.md

Changing the font in a mapboxgl map is really only possible by using a font in the Mapbox Studio system.

      // map.current.setLayoutProperty(
      //   "country-label",
      //   "text-size",
      //   originalSize * Number(e.target.value)
      // );
      // map.current.getLayoutProperty()
      console.log(map.current);
View rng_rust.md

I am using a SeedableRng to make reproducible simulations.

Here's my get_rng function:

use rand::prelude::*;
use rand_xoshiro::rand_core::SeedableRng;
use rand_xoshiro::Xoshiro256StarStar;

pub fn get_rng() -> impl Rng {
View reading-source-code.md

Hey there!

I'm Ryan Rampersad and I'll be giving a talk titled The Art & Science of Reading Other People's Code.

I am looking for short nuggets of wisdom that I could add to my talk. I am sure we'll share many of the same ideas, but I bet there's some really unique and insightful advice, tips and tricks out there.

Want to give it a try?

View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div style="display: flex; justify-content: center">
<div style="padding: 1rem">