Skip to content

Instantly share code, notes, and snippets.

View ahlusar1989's full-sized avatar
๐Ÿ€
Let's Go!

Saran Ahluwalia ahlusar1989

๐Ÿ€
Let's Go!
View GitHub Profile
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
@ahlusar1989
ahlusar1989 / install_chrome_driver
Created June 15, 2016 18:20 — forked from thotmx/install_chrome_driver
Install chromedriver in Ubuntu (14.04)
$ sudo apt-get install chromium-chromedriver
$ sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/bin/chromedriver
+ python validation.py
Traceback (most recent call last):
File "validation.py", line 8, in <module>
driver = webdriver.Chrome('/usr/lib/chromium/chromedriver')
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 61, in __init__
self.service.start()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 69, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
[
{
"title": "DivvyCloud Inc. Main Page",
"author": "DivvyCloud",
"url": "http://divvycloud.com/"
}
]
@ahlusar1989
ahlusar1989 / rds_to_docker.md
Created September 4, 2016 14:21 — forked from rtorino/rds_to_docker.md
Moving a Postgres db from RDS to a Docker container

Make a backup from RDS

pg_dump -h <rds host> -p 5432 -F c -O -U <rds user> <db name> > db.dump

Restore the backup into a Docker container

docker run --rm --interactive --link <postgres container id>:postgres --volume $PWD/:/tmp/ postgres:latest /bin/bash -c 'pg_restore --verbose --clean --no-acl --no-owner -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres -d <db name> /tmp/db.dump'
@ahlusar1989
ahlusar1989 / int_additions.scala
Created September 4, 2016 14:22 — forked from herval/int_additions.scala
Manipulating maps with Monoids
object MindBlown extends App {
trait Monoid[A] {
def op(a1: A, a2: A): A
def zero: A
}
val intAddition = new Monoid[Int] {
override def op(a1: Int, a2: Int) = a1 + a2
override def zero = 0
}
app.use(function* (next) {
this.accountService = {};
for (const method in accountServiceClient) {
this.accountService[method] = function* () {
try {
return yield accountServiceClient[method].apply(null, arguments);
}
catch (e) {
requestLogger.error(e);
throw e;
/events?filter:collaborators_expire_at=2016-12-20&eventbrite_event_id=16160132391
@ahlusar1989
ahlusar1989 / index.html
Created December 25, 2016 17:53
OpenGL V1: Cube
<html>
<head>
<meta charset='utf-8'/>
</head>
<body style='margin:0px' onload='main()'>
<canvas id='your_canvas'
style='position: absolute; background-color: black;'></canvas>
</body>
</html>
@ahlusar1989
ahlusar1989 / index.html
Created December 25, 2016 22:19
WebGL Man
<canvas id="canvas"></canvas>
<script src="http://webgl2fundamentals.org/webgl/resources/twgl-full.min.js"></script>
<script src="http://webgl2fundamentals.org/webgl/resources/webgl-lessons-helper.js"></script>
<script src="http://webgl2fundamentals.org/webgl/resources/3d-math.js"></script>
<script src="http://webgl2fundamentals.org/webgl/resources/flattened-primitives.js"></script>