Skip to content

Instantly share code, notes, and snippets.

@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 / 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):
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({
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<h1>Hi All.</h1>
@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