Skip to content

Instantly share code, notes, and snippets.

@asharma-ror
asharma-ror / Twitter.rb
Last active May 13, 2016 17:54
Get user tweets from twitter
# ----- Following library will be needed ------
# gem install nokogiri
require 'nokogiri'
require 'open-uri'
class Twitter
def initialize(tweet_account)
@url = 'https://twitter.com/' + tweet_account
@asharma-ror
asharma-ror / memcached.sh
Created February 11, 2015 10:16
Installing Memcached on Ubuntu 14.04
sudo apt-get install memcached
ps aux | grep memcached | grep 11211
### response should be
### memcache 10197 0.0 0.0 51600 4252 ? Sl 15:17 0:00 /usr/bin/memcached -m 64 -p 11211 -u memcache -l 127.0.0.1
@asharma-ror
asharma-ror / elasticsearch.sh
Last active August 29, 2015 14:15
Installing ElasticSearch on Ubuntu 14.04 / Installing from the Debian software package
### Install Java
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Download and Install ElasticSearch
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb
sudo dpkg -i elasticsearch-1.3.1.deb
@asharma-ror
asharma-ror / transition.slider.js
Created March 11, 2013 20:50
You need to define anchor tag following way: Example#1: <a data-transition="transition" data-target="#wrapper" href="/network">My network</a> Example#2: <a data-transition="transition" data-target="#wrapper" href="/user">Me </a> then It will work as below video: https://github.com/blog/760-the-tree-slider
!function( $ ){
"use strict"
$.fn.transition = function ( response_target ) {
var anchor = this.get(0)
history.pushState({ path: anchor.path }, '', anchor.href)
$.get(anchor.href, function(data) {
$(response_target).slideTo(data)
})
return false
@asharma-ror
asharma-ror / scheduled_job.rb
Created July 26, 2012 08:30 — forked from kares/scheduled_job.rb
Recurring Job using Delayed::Job
#
# Recurring Job using Delayed::Job
#
# Setup Your job the "plain-old" DJ (perform) way, include this module
# and Your handler will re-schedule itself every time it succeeds.
#
# Sample :
#
# class MyJob
# include Delayed::ScheduledJob