Skip to content

Instantly share code, notes, and snippets.

=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@elchappo
elchappo / nginx
Created July 8, 2014 21:53 — forked from hisea/nginx
sudo cp nginx /etc/init.d/
sudo update-rc.d nginx defaults
sudo chmod +x /etc/init.d/nginx
/etc/init.d/nginx start
#!/bin/bash
set -eu
shopt -s nullglob
readonly base_dir=/var/lib/docker/registry
readonly output_dir=$(mktemp -d -t trace-images-XXXX)
readonly jq=/usr/bin/jq
readonly repository_dir=$base_dir/repositories
@elchappo
elchappo / 1) Install
Last active August 29, 2015 14:16 — forked from nghuuphuoc/1) Install
// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
@elchappo
elchappo / dbal-nullable.php
Created May 2, 2016 17:56 — forked from chrisguitarguy/dbal-nullable.php
Just in case anyone was wondering how set allow a column to be nullable with Doctrine DBAL's Schema later.
<?php
use Doctrine\DBAL\Schema\Schema;
// assuming you're using composer...
$loader = require __DIR__ . '/vendor/autoload.php';
$schema = new Schema();
$users = $schema->createTable('users');
version: '3'
services:
###############################
# Built from local Dockerfile #
###############################
web:
# Build the Dockerfile in this directory.
build: .
# Mount this directory as a volume at /app
volumes:
@elchappo
elchappo / Mac OS X: Open in Visual Studio Code
Created December 1, 2017 00:33 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@elchappo
elchappo / wordpress-change-domain-migration.sql
Created December 7, 2017 01:25 — forked from chuckreynolds/wordpress-change-domain-migration.sql
Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: always backup your database. __STEP2: change the ‘oldsite.com’ and ‘newsite.com’ variables to your own. __STEP3: make sure your databa…
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
/* only uncomment next line if you want all your current posts to post to RSS again as new */
#UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite);
#!/bin/python
# -*- coding: utf-8 -*-
from time import sleep
from random import randint
from selenium import webdriver
from pyvirtualdisplay import Display
class MuncherySpider():
def __init__(self):
@elchappo
elchappo / ezines.txt
Created October 23, 2022 17:27 — forked from helcaraxeals/ezines.txt
AppSec Ezines Url (https://github.com/Simpsonpt/AppSecEzine) from 1 to 309
https://gist.github.com/cure53/df34ea68c26441f3ae98f821ba1feb9c
http://goo.gl/ZIOZqG (+)
http://rol.im/asux/
https://bitbucket.org/decalage/oletools
https://goo.gl/fBEuSF (+)
https://intothesymmetry.blogspot.co.uk/2016/05/holy-redirecturi-batman.html
https://unlogic.co.uk/2016/04/12/binary-bomb-with-radare2-prelude/
http://www.oreilly.com/webops-perf/free/files/docker-security.pdf
http://goo.gl/QM0mZx (+)