Skip to content

Instantly share code, notes, and snippets.

View letronje's full-sized avatar

Manoj Mathai letronje

View GitHub Profile
#!/bin/bash
cd /usr/local/bin/
echo "Listing location of gem and ruby, Press enter to proceed"
which gem
which ruby
[
[ 0] #<Opus::Recommendation:0xc021140> {
:id => 5985,
:node_id => 579224,
:name => "Ganga Consultants IT Fresher Job at NCR Region: Software Engineer",
:description => "Ganga consultant is a leading enrollment firm providing man-power solutions in all areas like BPO, Marketing and Accounting etc. Now they are hiring fresher applicants who have deep knowledge of PHP, Core PHP, Sql and MySQL for the position of Software Engineer.\n\n*Skills Required*\n\n* Proficient Java, Dotnet, PHP, SQL Server ,web sites ,MS-SQL.\n\n* Good presentation and communication skills.\n\n* Good problem-solving skills and a new approach for new ideas.\n\n* Should be a good team player.\n\n* Ability to work under pressure.\n\n*Additional Information*\n\n* Role: Software Engineer\n\n* Function: IT/ Telecom - Software\n\n* Industry: IT/ Software\n\n* Location: NCR Region\n\n* CTC: As per industry standard\n",
:address => "Ganga Consultants Office No.23, Grou
Started GET "/fresher-jobs" for 127.0.0.1 at 2012-07-11 14:16:55 +0530
Processing by Sparta::RecommendationsController#index as HTML
Parameters: {"url_folder"=>"fresher-jobs"}
GET http://leo.yournextleaplocal.com:80/opus/recommendations.json?auth_token=&order=updated_at+DESC&pagination[page]=1&pagination[per_page]=20&query_options[bucket_type]=Opus%3A%3AJob&select[]=id&select[]=updated_at&select[]=bucket_type
--> 200 OK 1567 (251.3ms)
Rendered app/cells/related_recommendations/sidebar.html.haml (5.6ms)
Rendered app/cells/related_recommendations/footer.html.haml (6.2ms)
Rendered persia/recommendations/filter/_select.html.haml (2.2ms)
GET http://umbra.yournextleaplocal.com:80/geographies.json?auth_token=&query_options[geotype]=0&query_options[name]=India
--> 200 OK 231 (64.1ms)
class Searchable
module ClassMethods
def magic
puts "c"*100
define_method(:instance_method) do
self.class.class_helper
end
end
private
@letronje
letronje / private_class_methods.rb
Created February 7, 2013 04:45
private_class_methods
class Searchable
module ClassMethods
def magic
puts "c"*100
define_method(:instance_method) do
self.class.class_helper
end
end
private
@letronje
letronje / thread-safety.clj
Last active December 13, 2015 21:48
clojure thread safety, atoms vs vars
(def a (atom 0))
(defn atom-incrementer [] ; tries to increment 'a' 2e7 times
(dotimes [_ 2e7]
(swap! a inc)))
(dotimes [n 4]
(future (atom-incrementer))) ; create 4 threads, all running atom-incrementer
(defn atom-printer [] ; keeps printing 'a' till it reaches a fixed value
@letronje
letronje / map-to-properties.clj
Last active December 16, 2015 04:39
map-to-properties.clj
(ns clj-prop-dump-restore.core
(:require [clojure.string :refer [split]]
[clojure.java.io :refer [reader writer]])
(:import java.util.Properties))
(defn- split-key
"Split a string key to its subparts.
foo -> [foo]
foo.bar.baz -> [foo bar baz]"
@letronje
letronje / ajax-seq.js
Created April 17, 2013 14:32
ajax-seq.js
console.clear();
var urls = ['/url1', '/url2', '/url3', '/url4', '/url5' , '/url6'];
function randint(a, b){ return Math.floor((Math.random()*b)+a); }
var Renderer = function(){
var data = [];
var nextIndex = 0;
return {
notify: function(index, url, json){
@letronje
letronje / pg table inheritance.rb
Last active December 16, 2015 10:09
pg table inheritance
=begin
Gemfile:
activerecord-postgresql-extensions
=end
#db/migrate/create_answers.rb
@letronje
letronje / varnish
Created April 19, 2013 10:49
varnish
Routes:
match '/test/:id' => 'dummy#test'
match '/user/:id' => 'dummy#user'
-------------------------------------
Controller:
def test