Skip to content

Instantly share code, notes, and snippets.

View pdfowler's full-sized avatar

Patrick Fowler pdfowler

View GitHub Profile
@knoopx
knoopx / tachyons-to-tailwind-transform.js
Last active August 17, 2023 13:51
Transform tachyons classes to tailwind css (using babel-codemod)
// Installation:
// yarn add -D @codemod/cli @babel/plugin-syntax-jsx @babel/generator
import jsx from "@babel/plugin-syntax-jsx"
import generate from "@babel/generator"
const COLOR_MAP = {
"white": "white",
"near-white": "gray-100",
"light-gray": "gray-200",
@anvaka
anvaka / modules.md
Last active January 16, 2019 14:45
npm modules with highest pagerank

This excercise computes PageRank of npm dependencies graph.

  1. Download all npm modules: wget https://skimdb.npmjs.com/registry/_design/scratch/_view/byField
  2. Convert them into ngraph.graph using convertToGraph.js script.
  3. Run rank.js (see below):

Number of nodes: 123,969; Number of edges: 281,471; PageRank computed in 1,187 ms;

  1. underscore - 0.0132458168541106
  2. lodash - 0.012808245947189859
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active March 27, 2024 06:33
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx