Skip to content

Instantly share code, notes, and snippets.

@abdullahbutt
abdullahbutt / laravel alpha space validation rule
Last active December 5, 2018 01:16
laravel alpha space validation rule
In Laravel 5.4, I used the following way to define a alpha_spaces rule:
You can create a custom validation rule for this since this is a
pretty common rule that you might want to use on other part of your app
(or maybe on your next project).
--------------------------------------------------------------------------------------------
on your app/Providers/AppServiceProvider.php
// Add below validator Namespace on top of file:
@ziadoz
ziadoz / install.sh
Last active April 7, 2024 16:04
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@dzitkowskik
dzitkowskik / SeleniumGridTutorial.md
Last active March 19, 2024 10:29
A simple tutorial of using selenium grid in python unittests

Prepare files & libraries

  1. Download selenium standalone server from: http://goo.gl/rQhaxb, Create local folder at ~/selenium and copy or move jar to that path:
$ mkdir ~/selenium
$ cd ~/selenium
$ wget http://goo.gl/rQhaxb
$ mv selenium-server-standalone-2.49.1.jar ~/selenium/
@pulse-
pulse- / gist:8655893
Created January 27, 2014 19:44
Django migrate sqlite3 db to postgres - The easy way.
I had this really small problem today. I wanted to migrate one of my small django apps to use postgres, just to make everything easy to manage. Sqlite3 is perfectly fine for the amount of load, however I am really much faster at administering postgres than I am on sqlite3. So I decided to migrate the stuff over.
I tried a few approaches, but what ultimately worked the best and the fastest fo rmy particular problem was to do the following.
Use original SQLITE3 connection in settings.py
1. python manage.py dumpdata > dump.json
(I read some things here about some options you can pass, at the end what just worked was the following)
2. Change DB connection string in settings.py to POSTGRES