<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ExportWriter
def initialize(export)
@export = export
end
def append(rows)
export interface AnalyticsEvent {
name: string;
props?: Record<string, unknown>;
ts: number;
}
<?php
namespace App\Validator;
use Symfony\Component\Validator\Constraint;
module Keysettable
extend ActiveSupport::Concern
included do
scope :keyset_page, ->(after: nil, limit: 20) do
relation = order(created_at: :asc, id: :asc).limit(limit + 1)
package config
import (
"encoding/json"
"fmt"
"time"
-- KEYS[1] = bucket key
-- ARGV: capacity, refillPerSec, now(ms), cost, ttl(sec)
local capacity = tonumber(ARGV[1])
local refill = tonumber(ARGV[2])
local now = tonumber(ARGV[3])
local cost = tonumber(ARGV[4])
use serde::Deserialize;
#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub server: ServerConfig,
import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
function hasActualValue(control: AbstractControl | null): boolean {
return !!control && control.value !== null && control.value !== '';
}
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import Transaction.Category;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct EmailAddress(String);
impl EmailAddress {
pub fn parse(raw: &str) -> Result<Self, String> {
if raw.contains('@') && !raw.starts_with('@') {
export const wizardMachine = {
initial: 'account',
states: {
account: {
next: 'profile',
canLeave: (data) => Boolean(data.email && data.password),