Skip to content

Instantly share code, notes, and snippets.

View Catorpilor's full-sized avatar
🎯
Focusing

Cheshire Catorpilor

🎯
Focusing
  • Beijing
View GitHub Profile
@Catorpilor
Catorpilor / go_cpu_memory_profiling_benchmarks.sh
Created April 3, 2020 15:08 — forked from arsham/go_cpu_memory_profiling_benchmarks.sh
Go cpu and memory profiling benchmarks. #golang #benchmark
FILENAME=$(basename $(pwd))
go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out -trace trace.out
go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf
go tool pprof -pdf --alloc_space $FILENAME.test mem.out > alloc_space.pdf && open alloc_space.pdf
go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf && open alloc_objects.pdf
go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
go tool trace trace.out
go-torch $FILENAME.test cpu.out -f ${FILENAME}_cpu.svg && open ${FILENAME}_cpu.svg
@Catorpilor
Catorpilor / README.md
Created March 3, 2020 04:28 — forked from bobrik/README.md
CFS hiccups
@Catorpilor
Catorpilor / keybase.md
Created September 10, 2019 14:33
keybase.md

Keybase proof

I hereby claim:

  • I am catorpilor on github.
  • I am chesh (https://keybase.io/chesh) on keybase.
  • I have a public key ASAhPV98Ioje1It3Sf76IndiXikf-viqwkrgNPcYnXzdBwo

To claim this, I am signing this object:

@Catorpilor
Catorpilor / keybase.md
Created September 10, 2019 14:15
keybase.md

Keybase proof

I hereby claim:

  • I am catorpilor on github.

  • I am chesh (https://keybase.io/chesh) on keybase.

  • I have a public key ASAhPV98Ioje1It3Sf76IndiXikf-viqwkrgNPcYnXzdBwo

04ca5837a276d784764b9d561bf2b8b8947f0b9ff6d383518e2aaea272d5dd2a5a93af6b6caca2decfff0b60955e62aba6b8e7595a7831daa69d8ceb322a389539
04ca5837a276d784764b9d561bf2b8b8947f0b9ff6d383518e2aaea272d5dd2a5a93af6b6caca2decfff0b60955e62aba6b8e7595a7831daa69d8ceb322a389539
@Catorpilor
Catorpilor / The Technical Interview Cheat Sheet.md
Created December 9, 2017 11:24 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@Catorpilor
Catorpilor / std.go
Created October 29, 2017 13:39
golang read from stdin
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
"time"
)
@Catorpilor
Catorpilor / app.js
Created May 23, 2017 13:18 — forked from acdlite/app.js
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@Catorpilor
Catorpilor / Dockerfile
Created May 15, 2017 13:09 — forked from vcabbage/Dockerfile
Multi-stage Dockerfile
FROM golang:alpine AS build
ADD . /go/src/github.com/my/project
WORKDIR /go/src/github.com/my/project
RUN go build -o /mybinary ./cmd/mybinary
FROM alpine:latest