Skip to content

Instantly share code, notes, and snippets.

View ymtdzzz's full-sized avatar
🏠
Working from home

Y.Matsuda ymtdzzz

🏠
Working from home
View GitHub Profile
@stuart-warren
stuart-warren / README.md
Last active April 8, 2024 22:00
Nix on Ubuntu

Setup on Fresh Ubuntu install

sudo apt install curl git
curl -L https://nixos.org/nix/install | sh -s -- --daemon
# follow prompts
git clone <this-repo> ~/nix
# edit files, replace my username with yours
cd ~
mkdir -p ~/.local/state/nix/profiles
@arsham
arsham / go_cpu_memory_profiling_benchmarks.sh
Last active June 7, 2024 07:52
Go cpu and memory profiling benchmarks. #golang #benchmark
go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt
go tool pprof -http :8080 cpu.out
go tool pprof -http :8081 mem.out
go tool trace trace.out
go tool pprof $FILENAME.test cpu.out
# (pprof) list <func name>
# go get -u golang.org/x/perf/cmd/benchstat
benchstat bench.txt
@vasanthk
vasanthk / System Design.md
Last active June 8, 2024 15:02
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 8, 2024 05:20
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@mwender
mwender / impbcopy.m
Last active June 1, 2024 01:23
Command line copy an image file to the clipboard in Mac OS X. See first comment for install instructions.
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <unistd.h>
BOOL copy_to_clipboard(NSString *path)
{
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage
NSImage * image;
if([path isEqualToString:@"-"])
{
// http://caiustheory.com/read-standard-input-using-objective-c