Skip to content

Instantly share code, notes, and snippets.

View crocarneiro's full-sized avatar

Carlos Rafael de Oliveira Carneiro crocarneiro

  • Caxias do Sul, RS, Brazil
View GitHub Profile
import bpy
outputFile = 'C:/tmp/mesh.csv'
verts = [ bpy.context.object.matrix_world @ v.co for v in bpy.context.object.data.vertices ]
csvLines = [ ";".join([ str(v) for v in co ]) + "\n" for co in verts ]
f = open( outputFile, 'w' )
f.writelines( csvLines )

About API versioning.

Commenting on the chapter 2.2.2 of the book "APIs on Rails: Building REST APIs with Rails" from Abraham Kuri Vargas. The author teaches us to version an API using the "Accept" header, which is his preferred way (he talks about the version in the URL approach too though). So you pass to this header something like application/vnd.marketplace.v1. Apparently the author learned this approach on the Rails Cast #350. Despite the amount of praise of the ones who got enlightened, this one comment concerned me: comment

This one comment aside, I got one more reason why I find this approach for API versioning concerning. Currently in the company I work on, our clients can use our APIs and get response in e

@crocarneiro
crocarneiro / ruby_study_01.md
Last active February 25, 2021 22:39
Ruby, saving code lines

Problem 1

Write a program that finds the summation of every number from 1 to num. The number will always be a positive integer greater than 0.

My solution

def summation(num)
  sum = 0
  range = 1..num
  range.each do | i |
 sum += i