Skip to content

Instantly share code, notes, and snippets.

View NikitaNaumenko's full-sized avatar
:shipit:
Just throwing a mysterious look in the Mexican hat

Nikita Naumenko NikitaNaumenko

:shipit:
Just throwing a mysterious look in the Mexican hat
View GitHub Profile
Invite.where('notify_at > ?', Time.current).find_each do |invite|
if invite.notify_before > 0
invite.update(notify_before_array: [invite.notify_before])
invite.event.update(notify_before_array: [event.invite.notify_before])
InviteNotification.create(invite: invite, event: event,
notify_at: invite.notify_at,
notify_before: invite.notife_before)
end
end
@NikitaNaumenko
NikitaNaumenko / memrise.js
Created January 7, 2023 08:11
download Memrise words into csv, just put it into console end press enter
let term = [...document.getElementsByClassName("col_a")].map(element => {
return element.getElementsByClassName("text")[0].innerText
});
let definition = [...document.getElementsByClassName("col_b")].map(element => {
return element.getElementsByClassName("text")[0].innerText
});
let rows = term.map(function(e, i) {
return [e, definition[i]];
});
@NikitaNaumenko
NikitaNaumenko / giphy.gif
Last active October 29, 2019 17:48
2.png
giphy.gif
class Morse
CODES = {
'E' => '.',
'T' => '-',
'I' => '..',
'A' => '.-',
'M' => '--',
'N' => '-.',
'S' => '...',
'U' => '..-',
require 'rack'
require 'json'
require 'pry'
require 'mustermann'
class Router
class App
attr_reader :resolver
def initialize(resolver)
module AuthHelper
def current_user
@current_user ||= User.find(session[:user_id]) if session[:user_id]
end
def signed_in?
session[:user_id] && User.find_by_id(session[:user_id])
end
def authenticate_user!