Skip to content

Instantly share code, notes, and snippets.

View tech4him1's full-sized avatar

Caleb tech4him1

View GitHub Profile
@tech4him1
tech4him1 / lessjs.rb
Last active December 29, 2016 01:24 — forked from andyfowler/lessjs.rb
Jekyll plugin to render LESS CSS
# encoding: utf-8
require 'jekyll/utils'
require 'open3'
# The official Node.JS `lessc` binary needs to be availible in the shell.
# `less_dir` defaults to `_less` but can be changed in `_config.yml`.
module Jekyll
class LessConverter < Converter
safe true
<h1>Hi All.</h1>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var Metalsmith = require('metalsmith')
var inPlace = require('metalsmith-in-place')
//`jstransformer-handlebars` needs installed, but not `require`d.
var bubbleGumHelper = function(){
return "bubblegum-bubblegum-bubblegum";
};
Metalsmith(__dirname)
.use(inPlace({
@tech4him1
tech4him1 / log_search.py
Last active September 8, 2017 20:51
Check log file for lines that take a lot of time.
import re
YARN_LOGFILE_REGEX = re.compile("^verbose ([0-9\.]*)")
# Maximum time per line.
MAX_TIME = 0.1
with open("install.log", 'r', encoding='utf16') as f:
lines = f.readlines()
for i in range(0, len(lines)):
if i+1 == len(lines):
@tech4him1
tech4him1 / more-than-0.5-seconds.log
Last active September 8, 2017 20:57
netlify-cms install time bottlenecks
verbose 0.785 Performing "GET" request to "https://registry.yarnpkg.com/netlify-cms".
verbose 1.389 Request "https://registry.yarnpkg.com/netlify-cms" finished with status code 200.
verbose 17.513 Performing "GET" request to "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.15.tgz".
verbose 35.358 Performing "GET" request to "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz".
verbose 35.358 Performing "GET" request to "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz".
verbose 42.599 Performing "GET" request to "https://registry.yarnpkg.com/netlify-cms/-/netlify-cms-0.5.0-beta.10.tgz".
verbose 59.79 Creating directory "./node_modules/lodash/fp".
@tech4him1
tech4him1 / cost-of-modules.log
Last active September 10, 2017 21:37
Netlify CMS modules sizes
┌─────────────────────────────────
─────┐
│ name │ children │ size │
├─────────────────────────────────
─────┤
│ @kadira/storybook │ 346 │ 45.14M │
├─────────────────────────────────
─────┤
│ material-design-icons │ 0 │ 43.74M │
├─────────────────────────────────

devDependencies

  • babel
  • babel-cli
  • babel-core
  • babel-jest
  • babel-loader
  • babel-plugin-lodash
  • babel-preset-es2015
  • babel-preset-react
@tech4him1
tech4him1 / checker.js
Last active September 21, 2017 01:21
Check if a dependency is used in a project.
const grep = require('shelljs').grep;
const deps = require('./package.json').dependencies;
require('shelljs').cd(`${ __dirname }/src`);
for (let dep in deps) {
const finds = grep(dep, ['*.js', '**/*.js']);
console.log(`${ dep }: ${ finds.length }`);
}
Package Current Wanted Latest Package Type
gotrue-js 0.9.3 0.9.8 0.9.8 dependencies
history 2.1.2 2.1.2. 4.7.2 dependencies
js-base64 2.1.9 2.3.2 2.3.2 dependencies
normalize.css 4.2.0 4.2.0. 7.0.0 dependencies
react-autosuggest 7.1.0 7.1.0. 9.3.2 dependencies
react-datetime 2.9.0 2.10.1 2.10.1 dependencies
react-redux 4.4.8 4.4.8. 5.0.6 dependencies
react-router 2.8.1 2.8.1. 4.2.0 dependencies