Skip to content

Instantly share code, notes, and snippets.

@benmerckx
benmerckx / absolute-to-relative.js
Created April 10, 2019 17:11 — forked from tibdex/absolute-to-relative.js
jscodeshift codemod to change imports of internal modules using absolute path to relative path
//jscodeshift --rootDirs ./src --packageDir . --extensions ts --parser tsx -t abs.js src
/**
* This codemod expects 2 CLI arguments:
* - packageDir: the path of the directory containing the package.json. It's used to detect whether a path points
* to a dependency or an internal module.
* - rootDirs: root directory paths separated by a comma if you have more than one root.
* Let's say that you have two files:
* - src/component.js
* - src/index.js containing the import "import Component from 'component.js';"
const path = require('path')
const fs = require('fs')
const [script, name] = process.argv.slice(2)
switch (script) {
case undefined:
case '-h':
case '--help':
console.log(`
nodejs port of appify v3.0.1 - http://mths.be/appify
/**
* Flowtype definitions for index
* Generated by Flowgen from a Typescript Definition
* Flowgen v1.2.0
* Author: [Joar Wilk](http://twitter.com/joarwilk)
* Repo: http://github.com/joarwilk/flowgen
*/
declare module 'mithril' {
const fs = require('fs')
const path = require('path')
const matcher = /xlink:href="data:(img|image)\/([a-z]+);base64,([^"]+)"/gi
const file = process.argv.pop()
const noop = function() {}
fs.readFile(file, 'utf-8', function (err, data) {
if (err) return console.error(err)
const name = path.basename(file, '.svg')
let newData = data
Windows Registry Editor Version 5.00
; Disable Bing search in start menu
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer]
"DisableSearchBoxSuggestions"=dword:00000001
; Remove Quick Access
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer]
"HubMode"=dword:00000001