Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am ekumachidi on github.
  • I am ekumac (https://keybase.io/ekumac) on keybase.
  • I have a public key ASBf_iD7e-5quNCBlTGzpFVQluFiHNMMWONtc1LJ4eVq3Ao

To claim this, I am signing this object:

@ekumachidi
ekumachidi / list_models.rb
Created Feb 17, 2020
List all classes in your rails app
View list_models.rb
Rails.application.eager_load!
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
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;
response.setHeader('Content-Type','application/json');
const parameters = request.body.result.parameters;
@ekumachidi
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
-- SCHEMA DEFINITION
CREATE TABLE customer (
`id` int,
`name` varchar(50),
`date_of_birth` date,
`phone_number` varchar(13),
`date_added` timestamp DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
View OfferLetter.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<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
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
else
puts "not #{input}"
end
end
View Overlay pictures.html
<!-- Sample code to overlay pictures -->
<div class="height-100vh center-aligned">
<!-- Background image or banner -->
<img class="background-image" src="http://i.imgur.com/1aBfM.png" />
<!-- Uploaded image -->
<img src="http://i.imgur.com/DH3Qw.png" class="text">
</div>
<style type="text/css">
body {