Skip to content

Instantly share code, notes, and snippets.


Babatope Ajepe ajepe

View GitHub Profile
ajepe / Odoo POS Over HTTP
Created Jun 11, 2018
Odoo POS Over HTTP
View Odoo POS Over HTTP
# Redirect POS to http
location ~ ^/pos/web {
rewrite ^(.*) http://$host:8069$1 permanent;
View email.js
function isValidEmailAddress(emailAddress) {
var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
return pattern.test(emailAddress);
ajepe / psql_encoding.markdown
Created Aug 8, 2018 — forked from joshteng/psql_encoding.markdown
This solves Postgresql's encoding issue (happened to me when running postgres on my vagrant box) The error happens when trying to create db "rake db:create": Error message: "encoding UTF8 does not match locale en_US; the chosen LC_CTYPE setting requires encoding LATIN1"
View psql_encoding.markdown
sudo su postgres
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
View gist:bb824f52817d6c9958d0ece0097c727b
* Created by PhpStorm.
* User: Raihan
* Date: 10-Jul-17
* Time: 4:37 AM
class CryptOpenssl{
private $hash;
ajepe / random number
Last active Jan 25, 2019
my crazy random number and otp
View random number
''.join([str(random.randint(0, 9)) for _ in range(11)])
def otp(length=5, lowerband=1, upperband=9):
return ''.join(
random.sample([str(random.randint(lowerband, upperband))
for _ in range(upperband+1)], length)
View gist:fdb8851684a058f254d4883bfb7ff79a
curl -gkvLI -H 'User-Agent: daemon 2.2' -H 'Accept: */*' -H 'Connection: Close' -H 'Accept-Language: en' -m 30 --connect-timeout 5
ajepe / md
Created Jan 15, 2019
Nigeria Banks sort code
View md
"070010": "ABBEY MORTGAGE BANK-070010",
"044": "ACCESS BANK PLC-044",
"323": "AccessMobile-100013",
"090134": "ACCION MICROFINANCE BANK-090134",
"100028": "AG MORTGAGE BANK PLC-100028",
"090116": "AMML MFB-090116",
ajepe / nginx
Created Apr 15, 2019
Odoo basic nginx conf
View nginx
#odoo server
upstream odoo {
upstream odoochat {
# http -> https
# server {
View Wget Crawl
wget -P build -nv -nH -r -E localhost:3000
ajepe / database.sql
Created Oct 16, 2019
Get database size
View database.sql
select t1.datname AS db_name,
pg_size_pretty(pg_database_size(t1.datname)) as db_size
from pg_database t1
order by pg_database_size(t1.datname) desc;