Skip to content

Instantly share code, notes, and snippets.

View sudo-suhas's full-sized avatar

Suhas Karanth sudo-suhas

View GitHub Profile

pprof

With a single import _ "net/http/pprof" you can add profiling endpoints to a HTTP server.

package main

import (
	"fmt"
@sudo-suhas
sudo-suhas / .zshenv
Created July 10, 2018 10:33
System setup
# Some options for our Zsh history. These will set our history to allow
# a ton more entires, ignore duplicate commands, and ignore some of the
# commands we don’t need a history of. This is useful because if you
# want to search for that command you ran a few weeks ago, you can do
# that a lot easier.
export HISTSIZE=32768;
export HISTFILESIZE=$HISTSIZE;
export HISTCONTROL=ignoredups;
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help";
@sudo-suhas
sudo-suhas / jest-report.md
Last active August 13, 2017 10:30
cosmiconfig - Sample migration to jest
 PASS  test\successful-files.test.js
  cosmiconfig.load
    sync
      √ loads defined JSON config path (4ms)
      √ loads defined YAML config path (1ms)
      √ loads defined JS config path (2ms)
      √ loads modularized JS file (2ms)
      √ runs transform (5ms)
 √ does not swallow transform errors (1ms)
@sudo-suhas
sudo-suhas / es-docs-console-script.txt
Last active March 28, 2017 06:27
Elasticsearch documentation reference test data CONSOLE sctipt
PUT twitter
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"mappings": {
"tweet": {
"properties": {
"user": {
@sudo-suhas
sudo-suhas / utils.js
Last active February 20, 2017 13:26
Sample code for Vue build utils
function cssLoaders(options = {}) {
const defaultLoaderOptions = !_.has(options, 'sourceMap') ? false : { sourceMap: options.sourceMap };
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap,
minimize: nodeEnv === 'production'
}
};