Skip to content

Instantly share code, notes, and snippets.

View vamsipavanmahesh's full-sized avatar

vamsi pavan mahesh gunturu vamsipavanmahesh

View GitHub Profile
@longlostnick
longlostnick / uploads_controller.rb
Created June 17, 2014 18:20
Rails JSON file upload with carrierwave (from base64 string)
class Api::UploadsController < ApiController
def create
@upload = Upload.new(upload_params)
ensure
clean_tempfile
end
private
@bbonamin
bbonamin / Gemfile
Created November 27, 2013 19:15
Bundler with multiple gemfiles. If your Gemfile becomes too big, you might want to split it.
source 'https://rubygems.org'
gemfiles = [ 'Gemfile1', 'Gemfile2' ]
gemfiles.each do |gemfile|
instance_eval File.read(gemfile)
end
@mycodeschool
mycodeschool / Stack_ArrayImplementation.C
Last active June 22, 2024 12:46
This is a basic array based implementation of stack data structure in C.
// Stack - Array based implementation.
// Creating a stack of integers.
#include<stdio.h>
#define MAX_SIZE 101
int A[MAX_SIZE]; // integer array to store the stack
int top = -1; // variable to mark top of stack in array
// Push operation to insert an element on top of stack.
@rdj
rdj / active_admin.rb
Created July 1, 2011 06:39
active_admin custom filter
# config/initializers/active_admin.rb
require 'active_admin_custom_filter'
ActiveAdmin.setup do |config|
# ...
end
@scottwb
scottwb / gist:398321
Created May 12, 2010 08:09 — forked from cypher/gist:150248
Git pre-commit hook to verify only valid ruby.
#!/usr/bin/env ruby
#
# A hook script to verify that only syntactically valid ruby code is commited.
# Called by git-commit with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# Put this code into a file called "pre-commit" inside your .git/hooks
# directory, and make sure it is executable ("chmod +x .git/hooks/pre-commit")
#