Skip to content

Instantly share code, notes, and snippets.

@heaven00
heaven00 / bobp-python.md
Created November 18, 2015 20:51 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@heaven00
heaven00 / rspec performance test
Created January 31, 2016 18:53 — forked from danbronsema/rspec performance test
Performance testing in Rspec
context 'performance' do
before do
require 'benchmark'
@posts = []
@users = []
8.times do |n|
user = Factory.create(:user)
@users << user
aspect = user.aspects.create(:name => 'people')
connect_users(@user, @aspect0, user, aspect)
@heaven00
heaven00 / cmd.sh
Created February 26, 2016 23:02 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@heaven00
heaven00 / web-servers.md
Created February 29, 2016 05:16 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@heaven00
heaven00 / development_profiler.rb
Created March 3, 2016 14:13 — forked from hiltmon/development_profiler.rb
Simple class to wrap a profile run around some code
class DevelopmentProfiler
def self.prof(file_name)
RubyProf.start
yield
results = RubyProf.stop
# Print a flat profile to text
File.open "#{Rails.root}/tmp/performance/#{file_name}-graph.html", 'w' do |file|
@heaven00
heaven00 / Install NVIDIA Driver and CUDA.md
Created January 24, 2017 20:36 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@heaven00
heaven00 / .env
Created March 28, 2024 23:14 — forked from tenekev/.env
Setting up Excalidraw with a Collaboration server
DOMAIN_NAME=yourdomain.tld
TZ=Europe/London