Skip to content

Instantly share code, notes, and snippets.

import webdriver from 'selenium-webdriver';
this.driver = new webdriver.Builder().forBrowser('chrome').build();
=>
var selenium_webdriver_1 = require("selenium-webdriver");
python -m sphinx.ext.intersphinx http://xlrd.readthedocs.io/en/latest/objects.inv > log
:func:`xlrd.open_workbook`
@chfw
chfw / gist:074bad40779cfd426de2ffd7f3cdc28b
Created May 11, 2017 11:29
sqlalchemy via maria db on fedora 22
go through the steps here: https://fedoraproject.org/wiki/MariaDB
sudo dnf install mariadb-devel
then pip install mysql-python
@chfw
chfw / gist:b619f02436c339db66a175a29531994a
Created January 17, 2017 14:35
oracle insert into table with seq
INSERT INTO USER_TABLE VALUES (SEQ_USER.NEXTVAL, 's', 'x');
@chfw
chfw / gist:e2e508f8b0183fda072ae11e8c4567a0
Created August 18, 2016 10:10
how to download static rpms for production centos
def production centos has no connection to internet except serving port
background production machine was not set up by you, hence you need to perform addtional setup.
1. get a replica of production centos and connect it to internet
2. `repotrack emacs -u |xargs wget`
exception:
if architecture differs, e.g. i386 local but x86_64 in production, you can do
it's been challenging to do that simple task, which is put a print statement in the emptied module file. when it comes to testing,
the first block is to how to test the output? one solution is to mock sys.stdout, the other is to wrap print in a function and patch it.
the second block is the module is already loaded and won't be loaded again. Hence you need to reload it. for reload, py2 and py3 had a
difference in where the reload comes from. here is the code to get around.
try:
reload
except NameError:
from imp import reload
@chfw
chfw / base64
Created March 15, 2016 10:52
inject base64 in karma
for test that has a dependency on base64
Error: [$injector:unpr] Unknown provider: $base64Provider <- $base64 <- <- Xcomponent
to get rid of it,
1) include bower_components/angular-base64/angular-base64.js in karma.conf.js
2) in the test case, put this along with others
@chfw
chfw / gist:708116e608cb84855d85
Created March 10, 2016 15:46
unit tests for angular 1.5.0 cannot be run inside phantomjs :'(
more details here https://github.com/angular/angular.js/issues/13794
@chfw
chfw / how to install ruby-compass on fedora 23 work station
Created February 25, 2016 11:20
how to install ruby-compass on fedora 23 work station
sympton:
[chfw@ gui]$ cat /home/chfw/.gem/ruby/extensions/x86-linux/ffi-1.9.10/gem_make.out
/usr/bin/ruby -r ./siteconf20160225-10482-1jrwbf5.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
http://archive.is/6V2bl