Skip to content

Instantly share code, notes, and snippets.

class SaleFilterForm
include ActiveModel::Model
include Virtus.model(nullify_blank: true)
attribute :from_price, Integer
attribute :to_price, Integer
attribute :from_year, Integer
attribute :to_year, Integer
attribute :with_images, Boolean, default: false
class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
nums = nums1 + nums2
nums = sorted(nums)
total = len(nums)
@astery
astery / my_app.ex
Created March 9, 2024 19:15 — forked from alanpeabody/my_app.ex
Websockets in Elixir with Cowboy and Plug
defmodule MyApp do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [
dispatch: dispatch
])