Skip to content

Instantly share code, notes, and snippets.

View gathuku's full-sized avatar
🎯
Focusing

Moses Gathuku gathuku

🎯
Focusing
View GitHub Profile
@gathuku
gathuku / GitCommitEmoji.md
Created April 9, 2019 20:27 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
<template id="">
<div>
<div x-data="{ open: false }" class="relative bg-gray-900 overflow-hidden">
<div class="max-w-screen-xl mx-auto ">
<div class="relative z-10 pb-8 bg-gray-900 sm:pb-16 md:pb-20 lg:max-w-2xl lg:w-full lg:pb-28 xl:pb-32">
<div class="pt-6 px-4 sm:px-6 lg:px-8">
<nav class="relative flex items-center justify-between sm:h-10 lg:justify-start">
<div class="flex items-center flex-grow flex-shrink-0 lg:flex-grow-0">
<div class="flex items-center justify-between w-full md:w-auto">
<a href="#">
@gathuku
gathuku / script.sh
Last active May 16, 2020 13:11
Check git changes with scripts
# returns true if changes present
if [[ `git status --porcelain` ]]; then
echo "Changes";
else
echo "No changes";
fi
# Check for a more specific file
# includes its name
@gathuku
gathuku / _form.html.erb
Last active February 23, 2021 12:42
Rails checkbox form
<%= form_with(model: user_group, local: true) do |form| %>
<% if user_group.errors.any? %>
<div id="error_explanation" class="alert alert-danger">
<h5><%= pluralize(user_group.errors.count, "error") %> prohibited this user group from being saved:</h5>
<ul>
<% user_group.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
class DeliveryMethods::AfricasTalking < Noticed::DeliveryMethods::Base
def deliver
post(url, format)
end
def format
{
username: credentials.fetch(:username),
to: recipient.tel.gsub(/\s+/, ''), # recepient phone number
message: notification.params[:message],
#
# This file tells systemd how to run Sidekiq as a 24/7 long-running daemon.
#
# Customize this file based on your bundler location, app directory, etc.
# Customize and copy this into /usr/lib/systemd/system (CentOS) or /lib/systemd/system (Ubuntu).
# Then run:
# - systemctl enable sidekiq
# - systemctl {start,stop,restart} sidekiq
#
# This file corresponds to a single Sidekiq process. Add multiple copies
/gems/redis-4.2.5/lib/redis.rb:60 in initialize
/gems/kredis-1.0.0/lib/kredis/railtie.rb:16 in new
/gems/kredis-1.0.0/lib/kredis/railtie.rb:16 in block (2 levels) in <class:Railtie>
/gems/kredis-1.0.0/lib/kredis/connections.rb:11 in block in configured_for
/gems/activesupport-6.1.4.1/lib/active_support/notifications.rb:203 in block in instrument
/gems/activesupport-6.1.4.1/lib/active_support/notifications/instrumenter.rb:24 in instrument
/gems/activesupport-6.1.4.1/lib/active_support/notifications.rb:203 in instrument
/gems/kredis-1.0.0/lib/kredis.rb:28 in instrument
/gems/kredis-1.0.0/lib/kredis/connections.rb:10 in configured_for
/gems/kredis-1.0.0/lib/kredis.rb:24 in redis