Skip to content

Instantly share code, notes, and snippets.

View fredx's full-sized avatar

Fred Zirdung fredx

  • RHI
  • San Francisco
View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active April 23, 2024 22:31
Multipart-POST Request Using Node.js

Multipart-POST Request Using Node.js

Here, I introduce 2 scripts for uploading files to Slack using Node.js as samples. These 2 sample scripts are for uploading files to Slack.

Sample script 1:

  • You can upload the zip file by converting byte array as follows.
    • At first, it builds form-data.
    • Adds the zip file converted to byte array and boundary using Buffer.concat().
    • This is used as body in request.
@pirj
pirj / Gemfile
Created August 16, 2012 15:38
Sinatra + Omniauth
source 'https://rubygems.org'
gem 'thin'
gem 'eventmachine', '1.0.0.rc.4'
gem 'sinatra'
gem 'sinatra-contrib', :require => 'sinatra/contrib'
gem 'sinatra-flash', :require => 'sinatra/flash'
gem 'rack-protection'