Skip to content

Instantly share code, notes, and snippets.

View lannonbr's full-sized avatar

Benjamin Lannon lannonbr

View GitHub Profile
@lannonbr
lannonbr / lamba.rb
Last active November 23, 2015 03:56
An interesting look at lambdas in Ruby
puts -> () {
f = -> () { -> () { -> (n) { -> () { -> (n) { n + 1 }.(1) }.() }.("Hello!") }.() }
g = -> () { -> () { f.() }.() }
-> () { g.() }.()
}.()
@lannonbr
lannonbr / MirrorDirStats.txt
Last active June 29, 2017 17:01
The number of entries for individual directories on Clarkson's Mirror from 09/16 - 06/17
September 2016
---
alpine: 4265 entries
archlinux: 9792 entries
blender: 0 entries
centos: 1028410 entries
clonezilla: 4619 entries
cpan: 1685 entries
cran: 7569 entries
ctan: 6547 entries
@lannonbr
lannonbr / roosevelt-labels.json
Created December 6, 2018 14:57
Labels to be deployed across rooseveltframework org using lannonbr/issue-label-manager-cli
[
{ "name": "blocked", "color": "8e44ad", "description": "Cannot be worked on until other issues / PRs are resolved" },
{ "name": "breaking", "color": "96281b", "description": "Change will require a major version bump" },
{ "name": "bug", "color": "d73a4a" },
{ "name": "discussion", "color": "6bb9f0" },
{ "name": "documentation", "color": "446cb3" },
{ "name": "duplicate", "color": "cfd3d7" },
{ "name": "engineering", "color": "f7ca18", "description": "Pertains to infrastructure around project (CI, build tools, etc)" },
{ "name": "enhancement", "color": "a2eeef", "description": "Planned feature" },
{ "name": "good first issue", "color": "7057ff", "description": "If you're new to the project, this would be a good issue to try resolving first" },
@lannonbr
lannonbr / learning.md
Created February 1, 2019 16:17
List of things I'd reccomend to people when they ask "how do I learn X?"
@lannonbr
lannonbr / docsStubParser.js
Created February 23, 2019 04:06
A small node script to figure out the number of stubs in gatsby's docs compared to the total number of docs
const yamlParser = require("js-yaml");
const fs = require("fs");
const path = require("path");
const doc = yamlParser.safeLoad(
fs.readFileSync(path.join(__dirname, "doc-links.yaml"))
);
const doc2 = yamlParser.safeLoad(
fs.readFileSync(path.join(__dirname, "contributing-links.yaml"))
@lannonbr
lannonbr / scrollbug.html
Created October 3, 2019 13:09
Bug that window.scrollTo running immediately works in firefox, but not chrome, and can be fixed with a setTimeout(callback, 0)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {
width: 10000px;
@lannonbr
lannonbr / build-on-push.yml
Created November 5, 2019 01:17
GitHub Actions example of doing a build on push excluding when changes are made in the .github folder
name: Build on push
on:
push:
paths-ignore:
- ".github/**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
@lannonbr
lannonbr / base-check.yml
Created December 8, 2019 22:41
Do stuff only in a main repo and not forks
on: push
name: Workflow
jobs:
work:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- id: base_check
name: check if repo is base
run: |
day hour value
Sun 0 2
Sun 1 2
Sun 2 3
Sun 3 3
Sun 4 4
Sun 5 2
Sun 6 2
Sun 7 2
Sun 8 2
@lannonbr
lannonbr / lib.js
Created January 7, 2020 15:06
Using fs.readFileSync in Rust with WASM
const fs = require('fs')
function readFile(path) {
return fs.readFileSync(path, { encoding: 'utf8' })
}
module.exports = {
readFile
}