Skip to content

Instantly share code, notes, and snippets.

View dineshprabu-freshdesk's full-sized avatar

Dineshprabu S dineshprabu-freshdesk

View GitHub Profile
@dineshprabu-freshdesk
dineshprabu-freshdesk / path_finder.txt
Created October 24, 2016 07:01
Solution Articles Tracker.
//To the Beginning of page layout - Functions for cookie access
<script>
function createCookie(name, value, days) {
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
}
else var expires = "";
@dineshprabu-freshdesk
dineshprabu-freshdesk / ruby_async_http.rb
Created December 1, 2016 15:55
[Ruby] Async HTTP request with Faraday and EM
require 'em-http-request'
require 'faraday'
conn = Faraday.new "http://httpbin.org" do |con|
con.adapter :em_http
end
r = conn.get '/ip'
p r.finished? #For checking completion
#Run on completion
r.on_complete{
p r.body
@dineshprabu-freshdesk
dineshprabu-freshdesk / starting_unicorn.rb
Created April 27, 2017 09:43
[Unicorn] Starting unicorn
bundle exec unicorn -c config/unicorn.rb
@dineshprabu-freshdesk
dineshprabu-freshdesk / tornado_async_example.py
Last active July 31, 2017 15:43
[Python] Tornado Example
import tornado.web
from tornado.ioloop import IOLoop
from tornado import gen
from tornado.concurrent import run_on_executor
from concurrent.futures import ThreadPoolExecutor
MAX_WORKERS = 16
class TestHandler(tornado.web.RequestHandler):
function search(tag){
// Considering request returns promise.
return request('http://google.com?q='+tag);
}
search('monard')
.then(function(response){
console.log(response);
})
.catch(function(searchError){
/*!
* Bootstrap v3.1.1 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;heigh
/* ========================================================
*
* Londinium - premium responsive admin template
*
* ========================================================
*
* File: londinium-theme.css;
* Description: Custom template styles for Bootstrap framework.
* Version: 1.0
@font-face {
font-family: 'icomoon';
src:url('icons/icons.eot');
src:url('icons/icons.eot?#iefix') format('embedded-opentype'),
url('icons/icons.woff') format('woff'),
url('icons/icons.ttf') format('truetype'),
url('icons/icons.svg#icons') format('svg');
font-weight: normal;
font-style: normal;
}
/* ========================================================
*
* Londinium - premium responsive admin template
*
* ========================================================
*
* File: styles.css;
* Description: General template styles.
* Version: 1.0
774f 4646 4f54 544f 0002 75cc 000b 0000
0004 4ef0 0001 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 4346 4620
0000 0108 0002 70f9 0004 3c1b 4c94 d0e3
4646 544d 0002 7204 0000 001a 0000 001c
677b a7e4 4744 4546 0002 7220 0000 001f
0000 0020 03b4 0004 4f53 2f32 0002 7240
0000 004b 0000 0060 2fdf dc61 636d 6170
0002 728c 0000 003e 0000 0152 e71b f2cc
6865 6164 0002 72cc 0000 002e 0000 0036