Skip to content

Instantly share code, notes, and snippets.

View idlecool's full-sized avatar

Shiv Deepak idlecool

  • Aeroh, Inc.
  • Mountain View, CA
View GitHub Profile
;;add autoload dir
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/")
(add-to-list 'load-path "~/.emacs.d/plugins/")
;;load plugins
(require 'linum+)
(require 'css-mode)
(require 'php-mode)
(require 'gist)
#!/usr/bin/python
def main():
result = {}
while(True):
try:
eachline = raw_input()
except(EOFError):
break
from flask import Flask, make_response
app = Flask(__name__)
import json
import time
@app.route('/data.json')
def data_json():
f = open("data.json")
resp = make_response(f.read())
Mozilla/5.0 (compatible; woriobot support [at] worio [dot] com +http://worio.com)
EventMachine HttpClient
MxAgent
Mozilla
Comodo-Certificates-Spider
JS-Kit URL Resolver, http://js-kit.com/
curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Googlebot/2.1 (http://www.googlebot.com/bot.html)
libwww-perl/5.834
Jakarta Commons-HttpClient/3.1
$ sudo yum update
$ sudo yum install openssl-devel
$ sudo yum install gcc-c++
$ wget -c http://znc.in/releases/znc-latest.tar.gz
$ tar -xzvf znc-latest.tar.gz
$ cd znc*
$ ./configure
$ make
$ sudo make install
diff --git a/hello.py b/hello.py
index 80cc4e8..ca67ce9 100644
--- a/hello.py
+++ b/hello.py
@@ -12,7 +12,7 @@ def index():
if request.method == 'GET':
return make_response(render_template('index.html'));
if request.method == 'POST':
- scrape.returnmarkovised()
+ return returnmarkovised()
import sys
x = sys.stdin.readlines()
line1 = x[1]
done = 0
line1 = line1.split()
for k in xrange(len(line1)):
if line1[k] == '-1':
print 0, k
<script type="text/javascript">
function trackTimeSpent() {
var isActive = $.cookie("_active_duration");
var timeSpent = $.cookie("_total_time_spent");
var d1, d2;
if (isActive) { return; }
if (!timeSpent) { timeSpent = 0; }
if (parseInt(timeSpent) % 10 === 0) {
<script type="text/javascript">
window.accessTime = parseInt("{{ access_date }}");
function trackTimeSpent() {
var userId = $.cookie("_user_id");
var isActive = $.cookie("_active_duration");
var timeSpent = $.cookie("_total_time_spent");
var currDate = $.cookie("_curr_date");
var d1, d2;
var loggedin;
if (window.statsServerTime != undefined) {
function userOnSite() {
var currentTime = new Date(), futureTime = new Date(currentTime);
futureTime.setMinutes(currentTime.getMinutes() + 30);
$.cookie('_user_on_site', true, {expires: futureTime});
}
userOnSite();
$(window).scroll(function(e) { userOnSite(); });
$(window).keypress(function(e) { userOnSite(); });