Skip to content

Instantly share code, notes, and snippets.

#### transcoder.rb ####
class Transcoder < Message
STATUS_SUBMITTED = "Submitted"
STATUS_PROGRESSING = "Progressing"
STATUS_COMPLETE = "Complete"
STATUS_CANCELED = "Canceled"
STATUS_ERROR = "Error"
def initialize(message)
Notes on how to use AWS SNS:
1. Subscribe an HTTP endpoint (i.e. http://myhost/sns_endpoint) on AWS Console
2. AWS will send subscription confirmation right away
3. SNS_controller responds to subscription confirmation by sending confirmation using Fog.
4. Once AWS is happy, you can start sending notifications to your end point via SNS.
@randika
randika / notes.sh
Created March 31, 2015 06:08
How to delete all lines of file in Vim
Problem
To delete all the lines of a file that is open in Vim.
Solution
Type `gg` to move the cursor to the first line of the file, if it is not already there.
Type `dG` to delete all the lines.
@randika
randika / fix.txt
Created October 19, 2014 03:44
Fix Couldn't find file 'jquery-ui' with rails 4 app
# Gemfile
gem 'jquery-ui-rails'
$ bundle update jquery-ui-rails
Installing jquery-ui-rails 5.0.2 (was 4.2.1)
# application.js
//= require jquery
//= require jquery-ui
//= require jquery_ujs
require 'aws'
AWS.config(:access_key_id => 'XXXXX', :secret_access_key => 'XXXXX')
pipeline_id = 'XXXXXXX'
preset_id = 'XXXXXX'
s3 = AWS::S3.new
bin = s3.buckets['XXXXXX-in']
bout = s3.buckets['XXXXXX-out']
$baseFontSize: 12px;
$navbarCollapseWidth: 979px;
$navbarHeight: 40px;
$navbarBackgroundHighlight: #49AFCD; /* 49AFCD 1EA7C4 2185C5*/
$navbarBackground: darken($navbarBackgroundHighlight, 5%);
$navbarBorder: darken($navbarBackground, 12%);
# An example of elasticsearch & Tire setup for ActiveRecord associations.
#
# A `Book has_many :chapters` scenario, with mapping and JSON serialization
# for indexing associated models.
#
# Demonstrates three important caveats as of now:
#
# 1. You you have to use `touch: true` in the `belongs_to` declaration,
# to automatically notify the parent model about the update.
#
@randika
randika / conf.md
Last active August 29, 2015 14:02
*Nix command collection

###SMART FILE BACKUPS###

cp PATH_TO_FILE PATH_TO_FILE.$(date "+%b_%d_%Y_%H.%M.%S")

cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.$(date "+%Y%m%d%H%M%S")

@randika
randika / config.notes.md
Last active August 29, 2015 14:01
CONFIG_NOTES
user www-data;
pid /run/nginx.pid;
worker_processes auto; # was set to 8
worker_rlimit_nofile 100000;
events {
worker_connections 1024;
multi_accept on;
}
http {