Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am ekumachidi on github.
  • I am ekumac ( on keybase.
  • I have a public key ASBf_iD7e-5quNCBlTGzpFVQluFiHNMMWONtc1LJ4eVq3Ao

To claim this, I am signing this object:

ekumachidi / list_models.rb
Created Feb 17, 2020
List all classes in your rails app
View list_models.rb
ActiveRecord::Base.descendants # It returns all models and its attributes.
ActiveRecord::Base.descendants.collect(&:name) # It returns only the model names
# If you're using > rails 5.0 you can use the line below
ApplicationRecord.descendants.collect(&:name) # It returns only the model names
View rspec_cheatsheet_controller_spec.rb
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
ekumachidi / virtualbanker.js
Created Nov 25, 2018
firebase functions for virtual banker
View virtualbanker.js
'use strict';
var https = require('https');
const functions = require('firebase-functions');
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
const action = request.body.result.action;
const parameters = request.body.result.parameters;
ekumachidi / OneFi SQL Test – QA Support Candidate.sql
Last active Nov 25, 2018
Instruction For this test, MySQL 5+ dialect of SQL is preferred, however, you can write your SQL in any other dialect you prefer. Just indicate that in your solution. \n Foryour solution, please send a single test file, begin solution to different questions using a comment, and end your queries with a semicolon (;). See db-fiddle here: https://w…
View OneFi SQL Test – QA Support Candidate.sql
CREATE TABLE customer (
`id` int,
`name` varchar(50),
`date_of_birth` date,
`phone_number` varchar(13),
`date_added` timestamp DEFAULT CURRENT_TIMESTAMP,
View OfferLetter.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Offer Letter</title>
<style type="text/css">
/* Take care of image borders and formatting */
ekumachidi / gist:f0924d14149ab9883b35c0d83b5427ee
Created Nov 11, 2017 — forked from trcarden/gist:3295935
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
View gist:f0924d14149ab9883b35c0d83b5427ee
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
View PaymentSchedulesController.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using VendorManagement.DAL.Data;
View viking.rb
# Viking Academy Coding challenge
def not_string(input)
if input.partition(" ").first == "Not" || input.partition(" ").first =="not"
puts input
puts "not #{input}"
View Overlay pictures.html
<!-- Sample code to overlay pictures -->
<div class="height-100vh center-aligned">
<!-- Background image or banner -->
<img class="background-image" src="" />
<!-- Uploaded image -->
<img src="" class="text">
<style type="text/css">
body {