Skip to content

Instantly share code, notes, and snippets.

View aman-gautam's full-sized avatar
💭
Building Products... Always Learning!

Aman Gautam aman-gautam

💭
Building Products... Always Learning!
View GitHub Profile
@robcowie
robcowie / tornado_socket_server.py
Created May 16, 2011 15:48
Simple example of creating a socket server with Tornado
import errno
import functools
import socket
from tornado import ioloop, iostream
class Connection(object):
def __init__(self, connection):
self.stream = iostream.IOStream(connection)
self._read()
@jholster
jholster / gist:2290574
Created April 3, 2012 09:06
Tornado multiprocess example
import tornado.web
import tornado.httpserver
import tornado.ioloop
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Greetings from the instance %s!" % tornado.process.task_id())
app = tornado.web.Application([
(r"/", MainHandler),
@jeromeetienne
jeromeetienne / multiline.js
Last active June 10, 2019 20:59
a snippet to have multi lines string in javascript.
var multilineString = (function(){ /*
this
is
a
multiline
string.
*/}).toString().split('\n').slice(1, -1).join('\n');
console.log(multilineString);
@dmpeters
dmpeters / librets_install.txt
Created July 15, 2014 21:56
librets installations with python bindings only
# Debian 7 x64, Ubuntu 14.04 x64, Ubuntu 12.04.4 x64
*NOTE (tested on Digital Ocean VM's w/ > 512MB of RAM - gcc runs out of memory on VM's <= 512 MB)
apt-get update
aptitude safe-upgrade
apt-get install build-essential libboost-all-dev libcurl4-gnutls-dev autoconf antlr swig python-dev
*NOTE (for python 3 support add 'python3-dev' to the end of line 5)
cd /tmp
wget https://github.com/NationalAssociationOfRealtors/libRETS/archive/1.6.1.tar.gz
@KrustyHack
KrustyHack / web_scraping_emails_website.sh
Last active March 5, 2024 10:26
Scrape a website with wget and get uniques emails from it or scrap websites whois to get email
#!/bin/bash
DOMAINS=$1
TMP_DIR=$2
if [[ "$DOMAINS" == "" || "$TMP_DIR" == "" ]] ; then
echo -e "Usage : script.sh DOMAINS.txt (with one domain per line) TMP_DIR"
echo -e "Example : ./script.sh mydomains.txt /tmp"
exit 1
fi