Skip to content

Instantly share code, notes, and snippets.

View webzorg's full-sized avatar
🖖
rb

Lasha Abulashvili webzorg

🖖
rb
  • Tbilisi, Georgia
View GitHub Profile
class User < ApplicationRecord
has_many :wallets
end
class Currency < ApplicationRecord
has_many :wallets
end
class Wallet < ApplicationRecord
belongs_to :currency
module ApplicationHelper
def bell_notification_with_conditional_counter
if Notification.unread_count(current_user).zero?
icon("fas", "bell", class: "notification-bell")
else
icon("fas", "bell", class: "notification-bell", data: { count: Notification.unread_count(current_user) })
end
end
import { Controller } from "stimulus"
export default class extends Controller {
static targets = ["name", "description", "category", "list"]
postSuccess(event) {
// console.log("ajax: success");
let [data, status, xhr] = event.detail;
this.listTarget.insertAdjacentHTML("afterbegin", xhr.response);
this.nameTarget.value = "";
class Model < ApplicationRecord
has_many :tags
def generate_tag
tag = loop do
tag = (SecureRandom.random_number(9e9) + 1e9).to_i # 9 digit random int
break tag unless Tag.exists?(tag: tag)
end
tags.create(tag: tag)
end
სულ შეფასდა 348 ტრანზაქცია
************************
რეიტინგი კვირის დღეების მიხედვით:
{"Sunday"=>134,
"Monday"=>35,
"Tuesday"=>48,
"Wednesday"=>233,
"Thursday"=>114,
"Friday"=>243,

Keybase proof

I hereby claim:

  • I am webzorg on github.
  • I am dionysus69 (https://keybase.io/dionysus69) on keybase.
  • I have a public key whose fingerprint is 41A2 E9FB 01B5 4C5B 78A9 BAC6 A2F1 64FF F2C4 E3BE

To claim this, I am signing this object:

@webzorg
webzorg / ruby_grpc_lightning.md
Created February 16, 2018 09:05
How to write a Ruby gRPC client for the Lightning Network Daemon

How to write a Ruby gRPC client for the Lightning Network Daemon

Command sequence assumes you will stay in the same dir

  • Install dependencies (googleapis-common-protos is required due to the use of google/api/annotations.proto)
$ gem install grpc grpc-tools googleapis-common-protos
  • Clone the google api's repository (required due to the use of google/api/annotations.proto)