Skip to content

Instantly share code, notes, and snippets.

View Eazybright's full-sized avatar
🏠
Working from home

Kolawole Ezekiel Eazybright

🏠
Working from home
View GitHub Profile
@benkoshy
benkoshy / then_example.rb
Created July 1, 2025 09:16
An example of then
# https://benkoshy.github.io/2024/12/09/then-ruby-keyword.html
# this is a contrived example
# experiment with it in an IRB console.
# we want to:
# take a string
# add convert it to an int
# add 1 to that
# and then cube it
@tejasbubane
tejasbubane / postgresql_database_constraints.rb
Last active May 15, 2025 11:10
PostgreSQL database constraints in Rails
# frozen_string_literal: true
# Read the blog: https://tejasbubane.github.io/posts/using-postgres-database-constraints-in-rails/
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
# Activate the gem you are reporting the issue against.
<?php
namespace App\Http\Middleware;
use Closure;
use App\Reward;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
class RewardMiddleware
@AbdullahMagat
AbdullahMagat / Hackerrank Java Anagrams Solution
Created July 26, 2018 19:19
Hackerrank Java Anagrams Solution
import java.util.Scanner;
public class Solution {
static boolean isAnagram(String a, String b) {
// // once you declare a.toUppercase you should assign it to a. you cannot define it as just a.toUppercase...
// //I solved it with the long way however I could put a and b in a character array and then use Arrays.sort(arrayname). after this steps convert them to string and check if they are equel.
a=a.toUpperCase();
b=b.toUpperCase();
boolean ret = false;
StringBuilder c= new StringBuilder(b);
@Eazybright
Eazybright / eloquentJavaScript.js
Created February 19, 2018 19:09 — forked from alexhawkins/eloquentJavaScript.js
Solutions for Eloquent Javascript Chapter 3, 4 Exercises (Functions, Arrays, Objects)
'use strict';
/****************************************
* Chapter 3 Exercises: Functions
*****************************************
#EXERCISE 1: Minimum
The previous chapter introduced the standard function Math.min that returns
its smallest argument. We can do that ourselves now. Write a function min that
@Eazybright
Eazybright / gist:e9386f28af28d6ca69118d1c9e44bb18
Created February 19, 2018 16:03 — forked from nlapier/gist:eb394fe78ed28a25b1ed
Running solutions for Eloquent Javascript - comments are welcome!
/****************************
Chapter 4: Reversing an Array
*****************************
Arrays have a method reverse, which changes the array by inverting the order in which its elements appear.
For this exercise, write two functions, reverseArray and reverseArrayInPlace.
The first, reverseArray, takes an array as argument and produces a new array that has the same elements in the inverse order.
The second, reverseArrayInPlace, does what the reverse method does:
it modifies the array given as argument in order to reverse its elements. Neither may use the standard reverse method.
*/
@Eazybright
Eazybright / EloquentJS_SE0201.js
Created February 15, 2018 03:32 — forked from ivanteoh/EloquentJS_SE0201.js
My answer for exercise in Eloquent JavaScript Second Edition
/*
My answer for exercise 'Looping a triangle'
in Eloquent JavaScript Second Edition
Chapter 2 Program Structure
*/
var note = '';
for (var i = 0; i < 7; i++) {
console.log(note += '#');
}
@jarhoads
jarhoads / isogram.js
Last active June 5, 2018 01:26
Some ideas on checking for an isogram in javascript
var Isogram = function(w){
var word = w.toLowerCase().split('');
this.isIsogram = function(){
var letters = new Object(null);
for(var i = 0; i < word.length; i++){
@mrabbani
mrabbani / mailgun-config.md
Last active January 8, 2024 01:45
Laravel Mailgun Setup

Mailgun setup

  • install Guzzle HTTP library : composer require guzzlehttp/guzzle
  • [sign up to mailgun] (http://www.mailgun.com)
  • Go to Domains tab and click on domains
  • You will find the necessary data for .env setup
    • MAIL_DRIVER=mailgun
    • MAIL_HOST=smtp.mailgun.org
    • MAIL_PORT=587
    • MAIL_USERNAME=[email protected]
  • MAIL_PASSWORD=502fd951f7------------------------
@ivanteoh
ivanteoh / EloquentJS_SE0201.js
Last active May 26, 2019 19:38
My answer for exercise in Eloquent JavaScript Second Edition
/*
My answer for exercise 'Looping a triangle'
in Eloquent JavaScript Second Edition
Chapter 2 Program Structure
*/
var note = '';
for (var i = 0; i < 7; i++) {
console.log(note += '#');
}