Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
from selenium import webdriver
from pyvirtualdisplay import Display
import time
import timeit
def click_link_until_page_changes(browser, link_name, timeout_seconds=300):
start_time = timeit.default_timer()
current_page_id = browser.find_element_by_tag_name('html').id
@wilvk
wilvk / vgd.sh
Created April 11, 2017 23:21
Vagrant Global Destroy
#!/bin/bash
vagrant global-status | tail -n +3 | cut -d' ' -f1 | sed '/^$/q'|xargs -I %s vagrant destroy %s
@wilvk
wilvk / php_ansible_packages.txt
Last active April 6, 2017 04:44
Atom Packages for PHP Magento web development with Ansible
auto-reveal-in-sidebar
intentions
linter-ansible-linting
linter-htmlhint
monokai
php-integrator-annotations
php-integrator-call-tips
php-integrator-refactoring
save-session
ansible-snippets
@wilvk
wilvk / sg.py
Last active April 21, 2017 02:49
AWS Security Groups: Modifies an EC2 Security Group to only contain your current external ip address and specifies access to a list of ports (defaults to ports 80 and 443 if none specified). Tested with Python 2.7.12. Requires boto3
#!/usr/bin/python
import boto3
import sys
import os
from urllib2 import urlopen
default_region = 'ap-southeast-2'
default_port_array = [ 80, 443 ]
default_replace_ingress = True
@wilvk
wilvk / .vimrc
Last active October 3, 2018 22:25
My cross-platform Vim settings
set number " enable line numbers
set nocompatible " cygwin cursor compatibility
set backspace=indent,eol,start " allow backspaces
set ignorecase " ignore case-sensitive search
set pastetoggle=<leader>p " toggle paste mode
" begin vundle code
filetype plugin indent off
syntax off
set rtp+=~/.vim/bundle/Vundle.vim " set the runtime path for vundle
@wilvk
wilvk / select_list_regex.py
Last active November 21, 2016 04:05
Selects a subset of a list based on a matching regular expression
#!/usr/bin/python
DOCUMENTATION = '''
---
module: select_list_regex
short_description: Selects a subset of a list based on a matching regular expression
'''
EXAMPLES = '''
- name: Select hosts with the word Admin from a list of all hosts