This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import eu.timepit.refined.auto.autoUnwrap | |
import jakarta.mail.event.{MessageCountEvent, MessageCountListener} | |
import jakarta.mail.{Message, Session, Store} | |
import org.eclipse.angus.mail.imap.{IMAPFolder, SortTerm} | |
import zio.ZIO.{attempt, logInfo} | |
import zio.stream.{Stream, ZStream} | |
import zio.{Chunk, RIO, Scope, Task, ZIO} | |
import zio.durationInt | |
final case class MessageID( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package si.ogrodje.oge.scheduler | |
import cats.effect.unsafe.implicits.global | |
import cats.effect.{IO, Resource} | |
import fs2.Stream | |
import fs2.concurrent.Topic | |
import org.quartz.* | |
import org.quartz.JobBuilder.* | |
import org.quartz.TriggerBuilder.* | |
import org.quartz.impl.StdSchedulerFactory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple Recommendation Engine in Ruby | |
# Visit: http://otobrglez.opalab.com | |
# Author: Oto Brglez <otobrglez@gmail.com> | |
class Book < Struct.new(:title) | |
def words | |
@words ||= self.title.gsub(/[a-zA-Z]{3,}/).map(&:downcase).uniq.sort | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1) Put 's3' gem in Gemfile. | |
# 2) Create as3.yml configuration for S3 | |
# 3) Create initializer for as3.yml | |
# 4) Make "assets" folder inside your bucket | |
# 5) After running task run "RAILS_ENV=production rake assets:precompile" | |
# 6) Invoke task by running "rake as3:upload" | |
namespace :as3 do | |
desc "Uploads compiled assets (public/assets) to Amazone AS3" | |
task :upload do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
pkgs = import <nixpkgs> {}; | |
rubyEnv = pkgs.ruby_3_2.withPackages(p: with p; [ | |
pry | |
nokogiri | |
]); | |
in with pkgs; | |
mkShell { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.pinkstack.tttx | |
package mk2.services | |
import mk2.services.Protocol.Connected | |
import cats.* | |
import cats.effect.* | |
import cats.effect.std.Queue | |
import cats.syntax.all.* | |
import fs2.Stream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Oto Brglez - <otobrglez@gmail.com> | |
$folderPath = "dodo-was-here" | Resolve-Path | |
Get-ChildItem -Path $folderPath -Recurse -File | | |
ForEach-Object { | |
$newName = Join-Path (Split-Path $_.FullName) ` | |
-ChildPath ($_.FullName -replace $folderPath,'' -replace '/|\\','-' -replace '^(.)','') | |
Rename-Item -Path $_.FullName -NewName $newName -Force # -WhatIf | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Oto Brglez - <otobrglez@gmail.com> | |
import net.greghaines.jesque.client.{Client as JesqueClient, ClientImpl} | |
import net.greghaines.jesque.worker.{JobFactory, MapBasedJobFactory, WorkerImpl} | |
import net.greghaines.jesque.{Config as JesqueConfig, ConfigBuilder, Job as JesqueJob} | |
import zio.* | |
import zio.Clock.currentTime | |
import zio.Console.printLine | |
import zio.ZIO.{acquireRelease, attempt, blocking, fail, logDebug, logError, logInfo, service, succeed} | |
import zio.stream.ZStream.fromQueue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /* vim: set ai ts=4 ft=sh: */ | |
# | |
# Copyright 2011, The Android Open Source Project | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/Projects/compression-puzzle feature/red-language ● nix-env -iA nixpkgs.red | |
installing 'red-0.6.4' | |
error: Package ‘red-0.6.4’ in /nix/store/02jzg4iiafapgb2p77aspm6ama87qp5y-nixpkgs-22.05pre338661.3c52ea8c921/nixpkgs/pkgs/development/interpreters/red/default.nix:81 is not supported on ‘x86_64-darwin’, refusing to evaluate. | |
a) To temporarily allow packages that are unsupported for this system, you can use an environment variable | |
for a single invocation of the nix tools. | |
$ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 | |
b) For `nixos-rebuild` you can set |
NewerOlder