Skip to content

Instantly share code, notes, and snippets.

View sanyam-j's full-sized avatar

Sanyam Jain sanyam-j

View GitHub Profile
@sanyam-j
sanyam-j / redis.markdown
Created April 19, 2016 12:21 — forked from bdotdub/redis.markdown
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

@sanyam-j
sanyam-j / commands.md
Created January 13, 2016 16:29 — forked from ondrej-kvasnovsky/commands.md
Commands to install and configure ElasticSearch on Ubuntu

Install ElasticSearch and Java

1  wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
2  sudo dpkg -i elasticsearch-1.0.1.deb
3  sudo update-rc.d elasticsearch defaults 95 10
4  sudo add-apt-repository ppa:webupd8team/java
5  sudo apt-get update
6  sudo apt-get install oracle-java7-installer
7  java -version
This is easy to do but what if the process to get this information adds a significant amount of processing time? You can dynamically load the data from another URL. The first step is to setup the element:
<div class="hoverToolTip">Data</div>
Then you need to setup the javascript to load the data:
$('.hoverToolTip').tooltip({
title: hoverGetData,
html: true,
container: 'body',
});
#application_helper.rb
def s3_upload_policy_document(filename)
ret = {"expiration" => 30.minutes.from_now.utc.xmlschema,
"conditions" => [
{"bucket" => ENV['S3BUCKET']},
["starts-with", "$key", filename],
{"acl" => "private"},
{"success_action_status" => "200"},