Skip to content

Instantly share code, notes, and snippets.

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

João Pedro Netto jnettome

🏠
Working from home
View GitHub Profile
@jnettome
jnettome / sample.rb
Created December 17, 2023 15:37
export chatwoot messages as csv or json to use with LLMs
# loop through conversations and create a csv file with the conversation data
attributes = %w{conversation_id sender content}
generated = CSV.generate(headers: true) do |csv|
csv << attributes
Conversation.take(10).each do |conversation|
conversation.messages.where(content_type: 'text').each do |message|
who_sent = ""
if message.message_type == "incoming"
@jnettome
jnettome / curso_introdutorio_programacao
Created August 22, 2020 04:12
Curso Programacao Aninha
# Historia
- https://www.youtube.com/watch?v=mFdUqqwzbVs evolucao dos computadores
@jnettome
jnettome / cts-bluetooth-ble-uuid
Created July 22, 2020 16:47
Bluetooth LE (BLE) CTS errors
If you're getting that
00> <debug> ble_cts_c: BLE event handler called with event 0x10
00> <debug> ble_cts_c: BLE event handler called with event 0x12
00> <debug> ble_cts_c: BLE event handler called with event 0x50
accept the Pair/bond consent window
@jnettome
jnettome / gist:f4238f2dd268c0878c8de75738c4d57e
Created March 11, 2020 04:05
carrierwave-upload-with-amazon-s3-403-forbidden-error
https://stackoverflow.com/questions/16677579/carrierwave-upload-with-amazon-s3-403-forbidden-error/28375102#28375102
@jnettome
jnettome / ffmpeg mp4 and webm for web.md
Last active August 30, 2019 15:18
ffmpeg mp4 and webm for web

ffmpeg mp4 and webm for web

install ffmpeg https://gist.github.com/clayton/6196167

no audio

ffmpeg -i demo-player.mov -f webm -vcodec libvpx-vp9 -vb 1024k -an demo-player.webm

ffmpeg -i demo-player.mov -f mp4 -vcodec libx264 -vb 1024k -an -preset slow demo-player.mp4

Dubauuuuuuuu n3l3sssss sOh bAlInhA neH?????? FlAsH PrA QuE??
@jnettome
jnettome / html_form_to_json.js
Created August 7, 2018 20:47
html form values to json data
/**
* Retrieves input data from a form and returns it as a JSON object.
* @param {HTMLFormControlsCollection} elements the form elements
* @return {Object} form data as an object literal
*/
const formToJSON = elements => [].reduce.call(elements, (data, element) => {
data[element.name] = element.value;
return data;
@jnettome
jnettome / iugu_concerns.rb
Created April 16, 2018 18:06
create marketplace account on iugu (iugu-ruby)
# Using the iugu-ruby gem's fork from https://github.com/jnettome/iugu-ruby
module IuguConcerns
extend ActiveSupport::Concern
included do
def generate_iugu_subaccount!
return iugu_receiver_id if iugu_receiver_id
account = Iugu::Account.create(name: name, commission_percent: 0)
return fail account.errors.to_s if account.errors
find . -type f -size +150k -iname '*.png' -exec mogrify -verbose -format jpg -strip -resize 1920x1080">" -quality 80 -define jpeg:extent=140kb. {} \;
find . -type f -size +150k -iname '*.jpg' -exec mogrify -verbose -strip -resize 1920x1080">" -quality 80 -define jpeg:extent=140kb. {} \;
@jnettome
jnettome / autoexec.cfg
Created July 19, 2017 20:00
autoexec.cfg
rate "128000"
hud_scaling "1"
cl_interp "0.1"
cl_interp_ratio "1"
cl_cmdrate "128"
cl_updaterate "128"
fps_max "300"
net_graph "1"
net_graphheight "9999"