Skip to content

Instantly share code, notes, and snippets.

View heyalexej's full-sized avatar

Alexej heyalexej

  • rather hard to pin down
View GitHub Profile

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
@heyalexej
heyalexej / install-opera.sh
Created June 23, 2014 17:01
install opera from deb source
#!/bin/bash
# install opera (can change from beta to stable)
# watch out for possible change of pub key later in 2014. http://deb.opera.com/
wget -O - http://deb.opera.com/archive.key | sudo apt-key add -
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8492E35
sudo sh -c 'echo "# deb http://deb.opera.com/opera/ stable non-free #Opera Browser (final releases)" > /etc/apt/sources.list.d/opera.list'
sudo sh -c 'echo "deb http://deb.opera.com/opera-beta/ stable non-free #Opera Browser (beta releases)" >> /etc/apt/sources.list.d/opera.list'
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y opera

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
import time
import datetime
print "Time in seconds since the epoch: %s" %time.time()
print "Current date and time: " , datetime.datetime.now()
print "Or like this: " ,datetime.datetime.now().strftime("%y-%m-%d-%H-%M")
print "Current year: ", datetime.date.today().strftime("%Y")
print "Month of year: ", datetime.date.today().strftime("%B")
@heyalexej
heyalexej / gist:33bbc7f7e8d5647a9448
Created July 1, 2014 16:33
Python releases by version number
curl -s https://www.python.org/downloads/ | grep -o '/download/releases/[^<]*/' | awk -F/ '{ print $4 }' | cut -c1-3 | sort | uniq
@heyalexej
heyalexej / unique-permutations.py
Created July 2, 2014 18:11
create all unique permutations of a word. please comment if you know of more efficient ways to do it.
#!/usr/bin/env python2
import sys
from itertools import permutations
str1 = sys.argv[1]
str2 = int(len(str1))
def uniques(iterable, r=None):
'''weird behavior in itertools permutations.
@heyalexej
heyalexej / pg-packs
Created July 12, 2014 20:38
postgres packages
i postgresql - object-relational SQL database (supported
i A postgresql-9.3 - object-relational SQL database, version 9.
i A postgresql-client-9.3 - front-end programs for PostgreSQL 9.3
i A postgresql-client-common - manager for multiple PostgreSQL client ver
i A postgresql-common - PostgreSQL database-cluster manager
i postgresql-contrib - additional facilities for PostgreSQL (supp
i A postgresql-contrib-9.3 - additional facilities for PostgreSQL
@heyalexej
heyalexej / get-going.sh
Created July 14, 2014 21:12
install go through hg
# http://golang.org/doc/go1.2#go_tools_godoc
# Both binaries are still included with the distribution, but the source code
# for the godoc and vet commands has moved to the go.tools subrepository."
# a handful of nifty commands for installation through hg
export GOBIN=~/bin
export GOPATH=~/gocode
mkdir -p /tmp/upstream
mkdir -p ~/gocode
cd /tmp/upstream
hg clone https://code.google.com/p/go/
@heyalexej
heyalexej / mysql-password-reset.sh
Created July 16, 2014 01:34
reset mysql password
#!/usr/bin/env sh
set -e
# Stop MySQL
sudo /etc/init.d/mysql stop
# Start MySQL skipping checks
sudo mysqld --skip-grant-tables &
# Log in as root
@heyalexej
heyalexej / install-charles-proxy.sh
Last active October 14, 2023 19:47
install charles proxy from deb source
#!/usr/bin/env sh
set -e
# install charles proxy from deb sources.
# http://www.charlesproxy.com
sudo sh -c 'echo "deb http://www.charlesproxy.com/packages/apt/ charles-proxy main" > /etc/apt/sources.list.d/charles-proxy.list'
wget -q http://www.charlesproxy.com/packages/apt/PublicKey -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y charles-proxy