Skip to content

Instantly share code, notes, and snippets.

View carlosbaraza's full-sized avatar
🤔
Thinking

Carlos Baraza carlosbaraza

🤔
Thinking
View GitHub Profile
@carlosbaraza
carlosbaraza / export_all_stl.py
Last active September 14, 2023 08:09 — forked from hyOzd/export_all_stl.py
FreeCAD macro to export all visible parts as STL. Include all groups children.
#
# Export Root Bodies and Objects Inside Root Groups to STL
#
# This is a FreeCAD script to export all visible root bodies and objects inside root groups in STL mesh format.
# Files will be stored inside an "exported_YYYY-MM-DD_HH-mm-ss" subfolder and named as "documentname_groupname_bodylabel.stl" or "documentname_bodylabel.stl".
#
import FreeCAD
import os.path
import datetime
@carlosbaraza
carlosbaraza / bench_rails_memory_usage.rb
Created January 8, 2016 10:31 — forked from brianhempel/bench_rails_memory_usage.rb
A script to test the memory usage of your Rails application over time. It will run 30 requests against the specified action and report the final RSS. Choose the URL to hit on line 45 and then run with `ruby bench_rails_memory_usage.rb`.
require "net/http"
def start_server
# Remove the X to enable the parameters for tuning.
# These are the default values as of Ruby 2.2.0.
@child = spawn(<<-EOC.split.join(" "))
XRUBY_GC_HEAP_FREE_SLOTS=4096
XRUBY_GC_HEAP_INIT_SLOTS=10000
XRUBY_GC_HEAP_GROWTH_FACTOR=1.8
XRUBY_GC_HEAP_GROWTH_MAX_SLOTS=0