Skip to content

Instantly share code, notes, and snippets.

View lvnilesh's full-sized avatar
💭
🏆 Vibranium Status Level

LV Nilesh lvnilesh

💭
🏆 Vibranium Status Level
View GitHub Profile
class CreateOauth2s < ActiveRecord::Migration
def self.up
create_table :oauth2s do |t|
t.string :api
t.string :refresh_token
t.string :access_token
t.datetime :expires_at
t.timestamps
end
# Ruby file to use the Google Prediction API, with a very hacked OAuth2
# You'll want to replace all the custom variables including..
# 1. Your google storage bucket name
# 2. Your google storage access credentials (note that gstore only works with "legacy" google storage access so you'll need to enabled this)
# 3. Your OAuth credentials which you setup from here https://code.google.com/apis/console/ by selecting "API Access"
# Note that I choose "Create client ID" and then "Installed Application".
#
# This script is intended to be run as a regular background process (like a cron job) to process data. It has no access to a browser and no web server to expose a callback url. Hence the hacking of OAuth2. This seems completely wrong to me but I haven't gotten any other authentication with the API to work. If anyone knows a better way please post a comment!
#
@lvnilesh
lvnilesh / rubber
Created December 16, 2012 19:18 — forked from anonymous/rubber
➜ Projects rails new app -d postgresql
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
@lvnilesh
lvnilesh / Cheffile
Created December 13, 2012 23:10 — forked from anonymous/Cheffile
#!/usr/bin/env ruby
#^syntax detection
site 'http://community.opscode.com/api/v1'
cookbook 'apache2'
1021 rberger $ knife cookbook bulk delete '.*' -p -c ~/.chef.production/knife.rb
[
"activemq",
"apache2",
"apparmor",
"application",
"apt",
"aws",
"boost",
"bootstrap",
@lvnilesh
lvnilesh / class2go.wsgi
Created December 7, 2012 23:23 — forked from nveid/class2go.wsgi
class2go.wsgi
import os, sys
import site
# Remember original sys.path.
prev_sys_path = list(sys.path)
# we add currently directory to path and change to it
pwd = os.path.dirname(os.path.abspath(__file__))
os.chdir(pwd)
sys.path = [pwd] + sys.path
@lvnilesh
lvnilesh / class2go.wsgi
Created December 7, 2012 23:23 — forked from nveid/class2go.wsgi
class2go.wsgi
import os, sys
import site
# Remember original sys.path.
prev_sys_path = list(sys.path)
# we add currently directory to path and change to it
pwd = os.path.dirname(os.path.abspath(__file__))
os.chdir(pwd)
sys.path = [pwd] + sys.path
@lvnilesh
lvnilesh / class2go.wsgi
Created December 7, 2012 23:23 — forked from nveid/class2go.wsgi
class2go.wsgi
import os, sys
import site
# Remember original sys.path.
prev_sys_path = list(sys.path)
# we add currently directory to path and change to it
pwd = os.path.dirname(os.path.abspath(__file__))
os.chdir(pwd)
sys.path = [pwd] + sys.path
@lvnilesh
lvnilesh / ec2_server_create.rb
Created November 30, 2012 06:22 — forked from markbirbeck/ec2_server_create.rb
A patch for the 'knife ec2 server create' command to enable use with chef-solo original https://raw.github.com/opscode/knife-ec2/master/lib/chef/knife/ec2_server_create.rb
#
# Author:: Adam Jacob (<[email protected]>)
# Author:: Seth Chisamore (<[email protected]>)
# Copyright:: Copyright (c) 2010-2011 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@lvnilesh
lvnilesh / Folder Preferences
Created August 23, 2012 04:21 — forked from chrisyour/Folder Preferences
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern