Skip to content

Instantly share code, notes, and snippets.

@czivko
czivko / application_controller.rb
Created Jan 8, 2019
Simple Auth Token security for RoR API Endpoint
View application_controller.rb
class Api::V1::ApplicationController < ActionController::API
include ActionView::Rendering
include ActionController::HttpAuthentication::Token::ControllerMethods
before_action :restrict_access
before_action :allow_cross_domain_access
respond_to :json
def options
render plain: { ok: :ok }.to_json, status: :ok, content_type: 'application/json'
end
View gist:25a603358e1d42badca203208c7a2a41
{
"documents":[
{
"email":"testerasdfasfd@test.com",
"phone_number":"901-942-8167",
"ip":"1.1.1.1",
"name":"Charlie Brown2",
"alias":"Snoopy",
"entity_type":"M",
"entity_scope":"Arts \u0026 Entertainment",
View ngrok crash 2
runtime.MHeap_Alloc(0x9922c0, 0x1, 0x1000000002b, 0x59c09)
aes/src/ngrok/toolchain/src/runtime/mheap.c:240 +0x66
runtime.MCentral_CacheSpan(0x99bc58, 0xc208522e58)
/Users/aes/src/ngrok/toolchain/src/runtime/mcentral.c:85 +0x167
runtime.MCache_Refill(0xa83e10, 0x2b, 0xaa0cd8)
/Users/aes/src/ngrok/toolchain/src/runtime/mcache.c:90 +0xa0
goroutine 14 [running]:
runtime.switchtoM()
/Users/aes/src/ngrok/toolchain/src/runtime/asm_amd64.s:198 fp=0xc208522d28 sp=0xc208522d20
View ngrok crash macOS Sierra 10.12
Foundfailed MSpanList_Insert 0xab4190 0x8d9e1bfb2d3 0x0
fatal error: MSpanList_Insert
runtime stack:
runtime.MSpanList_Insert(0x992a18, 0xab4190)
/Users/aes/src/ngrok/toolchain/src/runtime/mheap.c:692 +0x8f
runtime.MHeap_Alloc(0x9922c0, 0x2, 0x10000000026, 0x59c09)
/Users/aes/src/ngrok/toolchain/src/runtime/mheap.c:240 +0x66
runtime.MCentral_CacheSpan(0x99b6b8, 0xc2081d3090)
/Users/aes/src/ngrok/toolchain/src/runtime/mcentral.c:85 +0x167
View builds.md
@czivko
czivko / vendor-ffmpeg-x264-mp3lame-heroku
Last active Dec 10, 2015 — forked from coopermaruyama/vendor-ffmpeg-heroku
How to compile ffmpeg with h264 and mp3 encoders enabled for use on heroku.
View vendor-ffmpeg-x264-mp3lame-heroku
## Get FFMpeg working on heroku by building binaries using vulcan
# also added instructions on how to compile with libmp3lame and libx264
gem install vulcan
vulcan create foo
#clone the app vulcan just created
git clone git@heroku.com:foo
View params output
{
"utf8" =>"✓",
"authenticity_token" =>"L8ezPjizbUKbcgi6qHrYrXntBfTPPz1a8QSKqk+lvSk=",
"event" => {
"name" =>"one",
"start_time" =>"",
"end_time" =>"",
"venue_name" =>"",
"address" =>"",
"city" =>"",