Skip to content

Instantly share code, notes, and snippets.

View gabrielmancini's full-sized avatar

Gabriel Mancini de Campos gabrielmancini

View GitHub Profile
@atomkirk
atomkirk / cloud-files.md
Last active January 18, 2023 17:23
Storing files on S3 with Elixir

I have this abstraction in my application code called a "CloudFile". This is where I store in the database information about files on S3 and it gives me a resource for other resources to own. For example, a user would have an avatar_cloud_file_id. On the front-end, I would load this relationship and display the avatar with user.avatar_cloud_file.download_url

defmodule RL.CloudFile do
  use Ecto.Schema
  import Ecto.Changeset

  @timestamps_opts type: :utc_datetime_usec
@cblavier
cblavier / application.ex
Last active April 30, 2023 08:33
Cowboy 2.5 proxy, used to bind a single port (on Heroku) for umbrella Phoenix applications. It supports HTTPS and websockets properly.
defmodule MasterProxy.Application do
alias MyApp.Endpoint, as: MyAppEndpoint
alias MyApp.UserSocket, as: MyAppUserSocket
alias MyOtherApp.Endpoint, as: MyOtherAppEndpoint
alias MyOtherApp.UserSocket, as: MyOtherAppUserSocket
alias Phoenix.LiveReloader.Socket, as: LiveReloadSocket
alias Plug.Cowboy
@joaoneto
joaoneto / README.md
Last active May 23, 2016 21:12
Improve your curl with pretty formmated json responses

Improve your curl with pretty formmated json responses

requirements node.js

add in your .zshrc

[[ -s $HOME/bin/prettycurl.sh ]] && . $HOME/bin/prettycurl.sh
@bFlood
bFlood / gist:018ebb1fc8889a7e36ce
Created February 27, 2015 13:10
AppGyver GMaps Plugin config
iOS Plugin Config
{"source":"https://github.com/wf9a5m75/googlemaps-ios-sdk-for-phonegap"},
{"source":"https://github.com/bFlood/phonegap-googlemaps-plugin#appgyver_bf","variables":{"API_KEY_FOR_IOS":"your_valid_api_key"}},
{"source":"https://github.com/wf9a5m75/phonegap-http-request#app_gyver"},
Android Plugin Config
{"source":"https://github.com/wf9a5m75/phonegap-http-request#app_gyver"},
{"source":"https://github.com/bFlood/phonegap-googlemaps-plugin#appgyver_bf","variables":{"API_KEY_FOR_ANDROID":"your_valid_api_key"}},
@mainerror
mainerror / manifest.json
Created October 8, 2012 15:02
Futon Chrome App Manifest
{
"name": "Futon",
"version": "1.0",
"manifest_version": 2,
"description": "A simple Apache CouchDB Futon shortcut app.",
"icons": {
"128": "icon_128.png"
},
"app": {
"launch": {
@max-mapper
max-mapper / readme.md
Created December 16, 2011 19:54
december 2011 couchapp community meeting

as per a meeting on 12/16/11 with @caolanm, @mikeal, @tilgovi, @jchris and myself here is a rough summary of what we as the couchapp stewards discussed:

  • there was agreement that the major goal of couchapps (in general) is to offer a convention for building HTML5 applications that are independent of and transportable (isomorphic?) between databases. therefore the platforms onto which you can deploy a couchapp are very important as a selling point. the more the merrier

  • the deploy targets we discussed are: chrome extensions, ios + android with couchbase's stuff, phonegap, and desktop apps with Chrome Embedded Framework

  • there was contention over whether or not its a good idea to port the erlang VM to run erlang couch on all the things. now that chrome ships with leveldb turned on we think it would be awesome to get https://github.com/mikeal/pouchdb to a 1.0 release. for the first release you won't be able to store binary attachments in pouch (although once http://t.co/0fj35mFs lands in Chrome this will b

@KlausTrainer
KlausTrainer / delete_documents_from_view_result.rb
Created December 27, 2010 19:11
Delete all documents whose id appears in a given view result.
#!/usr/bin/env ruby
require 'rubygems'
require 'rest_client'
require 'json'
require 'cgi'
def bye
abort("Usage: #{$0} [view_url]\nExample: #{$0} http://admin:[email protected]:5984/db/_design/ddoc/_view/recent-posts")