This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
def main(): | |
result = {} | |
while(True): | |
try: | |
eachline = raw_input() | |
except(EOFError): | |
break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); }); |