Skip to content

Instantly share code, notes, and snippets.

View Anyoks's full-sized avatar

Dennis Orina Anyoks

View GitHub Profile
@Anyoks
Anyoks / run_guest_cypress_from_host.txt
Last active April 20, 2021 14:07
How to Run cypress on vagrant vm using the hosts GUI (Or any other app really)
Assuming you have correctly installed cypress and can run it headless: yarn run cypress run (or whichever way you run it, npm etc)
1. You need an X-Server on the host.
On Linux, you already have and X Server running
On Mac, On Mac OSX you can install XQuartz
2. Enable X-forwarding on your Vagrant VM
Just add this to your Vagrantfile
@Anyoks
Anyoks / VscodeUp
Created June 9, 2019 07:43
How to update VScode on Ubuntu preserving all configs.
sudo dpkg -r code
sudo dpkg -i code_downloaded_package.deb
@Anyoks
Anyoks / regexp.txt
Last active December 31, 2018 10:41
Matching Kenyan Phone Numbers with a reular expression.txt
To match 07xx xxx xxx number
/^0(7(?:(?:[129][0-9])|(?:0[0-8])|(4[0-1]))[0-9]{6})$/
To match +254 7xx xxx xxx
/^(?:+254)?(7(?:(?:[129][0-9])|(?:0[0-8])|(4[0-1]))[0-9]{6})$/
To match 254 7xx xxx xxx
@Anyoks
Anyoks / 00.md
Created April 12, 2018 11:29 — forked from maxivak/00.md
Sending emails with ActionMailer and Sidekiq

Sending emails with ActionMailer and Sidekiq

Send email asynchroniously using Sidekiq.

ActionMailer

Create your mailer us usual:

@Anyoks
Anyoks / web.org.conf
Last active March 22, 2018 15:56
Deploying two separate rails Apps to subdomain and main domain. These are the nginx conf files found in /etc/nginx/sites-available
#config for the domain
server {
listen 80 default_server;
listen [::]:80;
server_name miraclemanner.org miraclemanner.org;
passenger_enabled on;
passenger_app_root /home/deploy/miracle_manner/current;
rails_env production;
root /home/deploy/miracle_manner/current/public;
@Anyoks
Anyoks / Vagrantfile
Last active February 6, 2018 12:01
Setting vagrant vm with Ubuntu 16.04 and rails working environment. ( postgres 10, Rails 5, Ruby 2.5, and RVM)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"