Skip to content

Instantly share code, notes, and snippets.

View thiagoramos23's full-sized avatar

Thiago Ramos thiagoramos23

View GitHub Profile
@thiagoramos23
thiagoramos23 / RestServiceMultipart.swift
Last active October 28, 2015 15:03
Send Images wth multipart IOS Swift
func POST(delationType: String, description: String, referenceType: String, latitude: Double, longitude: Double, photos: [Photo], completionHandler: (object:AnyObject?, success: Bool) -> Void) -> Void {
let url:NSURL? = NSURL(string: "http://ima.rogalabs.com/api/v1/ombudsmen")
let request = NSMutableURLRequest(URL: url!)
request.HTTPMethod = "POST"
// Set Content-Type in HTTP header.
let boundary = "---------------------------14737809831466499882746641449"; // This should be auto-generated.
let contentType = "multipart/form-data; boundary=" + boundary
request.setValue(contentType, forHTTPHeaderField: "Content-Type")
@thiagoramos23
thiagoramos23 / deploy.rb
Created November 19, 2015 17:42 — forked from stas/deploy.rb
Mina Deploy Task (Rails + Puma + Delay Job + rbenv)
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# require 'mina/rvm' # for rvm support. (http://rvm.io)
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)
@thiagoramos23
thiagoramos23 / Rakefile.rb
Created August 23, 2017 23:24 — forked from drogus/Rakefile.rb
This is the example contents of the Rakefile, which you would use to run active record tasks without using Rails. It assumes using the same directories as rails uses: `db/migrate`, `config/database.yml`.
require 'bundler/setup'
require 'active_record'
include ActiveRecord::Tasks
db_dir = File.expand_path('../db', __FILE__)
config_dir = File.expand_path('../config', __FILE__)
DatabaseTasks.env = ENV['ENV'] || 'development'
body { background: #222; color: #e6e6e6; }
a { color: #949494; }
a:link, a:visited { color: #949494; }
a:hover, a:active, a:focus { color: #c7c7c7; }
hr { border-bottom: 1px solid #424242; border-top: 1px solid #222; }
@thiagoramos23
thiagoramos23 / where_is.rb
Created May 13, 2019 18:57 — forked from wtaysom/where_is.rb
A little Ruby module for finding the source location where class and methods are defined.
module Where
class <<self
attr_accessor :editor
def is_proc(proc)
source_location(proc)
end
def is_method(klass, method_name)
source_location(klass.method(method_name))
@thiagoramos23
thiagoramos23 / links.md
Last active November 7, 2019 18:47 — forked from akitaonrails/links.md
Links de referência pro Episódio 66 do Canal Akitando
@thiagoramos23
thiagoramos23 / transiftion-cross-effect.swift
Last active February 9, 2020 18:26 — forked from swiftui-lab/transiftion-cross-effect.swift
Transition in wich include the CircleShape Transition
// Advanced SwiftUI Transitions
// https://swiftui-lab.com
// https://swiftui-lab.com/advanced-transitions
import SwiftUI
struct CrossEffectDemo: View {
let animationDuration: Double = 2
let images = ["photo1", "photo2", "photo3", "photo4"]
@State private var idx = 0
@thiagoramos23
thiagoramos23 / cloudSettings
Last active June 22, 2020 15:14
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-06-20T22:30:42.934Z","extensionVersion":"v3.4.3"}
let mapleader=","
set nocompatible " be iMproved, required
filetype off " required
set cf " Enable error files & error jumping.
set clipboard+=unnamed " Yanks go on clipboard instead.
set history=256 " Number of things to remember in history.
set autowrite " Writes on make/shell commands
set ruler " Ruler on
@thiagoramos23
thiagoramos23 / .vimrc
Last active November 25, 2020 13:09
Last vimrc
syntax on
set nocompatible " be iMproved, required
filetype off " required
set clipboard+=unnamed "Yanks go on clipboard instead.
set history=256 "Number of things to remember in history.
set autowrite "Writes on make/shell commands
set ruler "Ruler on
set nu "Line numbers on
set nowrap "Line wrapping off