Skip to content

Instantly share code, notes, and snippets.

/**
* Created by IntelliJ IDEA.
* User: Milan Vít (Cellane)
* Date: May 12, 2010
* Time: 2:16:44 PM
*/
import java.text.MessageFormat;
public class MatrixDeterminant {
@Cellane
Cellane / autoload.lua
Created July 27, 2015 20:26
Amazing mpv scripts
-- This script automatically loads playlist entries before and after the
-- the currently played file. It does so by scanning the directory a file is
-- located in when starting playback. It sorts the directory entries
-- alphabetically, and adds entries before and after the current file to
-- the internal playlist. (It stops if the it would add an already existing
-- playlist entry at the same position - this makes it "stable".)
-- Add at most 5 * 2 files when starting a file (before + after).
MAXENTRIES = 5
function Set (t)
using System;
using System.Drawing;
namespace Convolution
{
public class Convolution
{
public Image DoMagic(Bitmap input, ConvolutionKernel kernel)
{
var output = new Bitmap(input.Width, input.Height);
defmodule LiveViewStudioWeb.SalesDashboardLive do
use LiveViewStudioWeb, :live_view
alias LiveViewStudio.Sales
def mount(_params, _session, socket) do
socket =
socket
|> assign_stats()
|> assign(refresh_interval: 5, refresh_ref: nil)
public class ComplexNumber {
private float real, imaginary;
public ComplexNumber () {
this (0f, 0f);
}
public ComplexNumber (float real, float imaginary) {
this.real = real;
this.imaginary = imaginary;
#!/bin/bash
IGNORED_IMAGES=("busybox" "debian:stretch-slim" "dokku/ambassador" "dokku/letsencrypt" "dokku/s3backup" "dokku/wait" "gliderlabs/herokuish:latest")
USED_IMAGES=("${IGNORED_IMAGES[@]}" $(docker container ls -a --format '{{.Image}}' | sort -u | uniq | awk -F ':' '$2{ print $1":"$2 }!$2{ print $1":latest" }'))
USED_IMAGE_IDS=()
ALL_IMAGE_IDS=($(docker image ls --format '{{.ID}}' | sort -u))
for image in "${USED_IMAGES[@]}"; do
IFS=":" read -a parameters <<<"$image"
@Cellane
Cellane / README.md
Last active January 20, 2020 05:49
Check updates for Docker images from Docker Hub or private repository, and deploy updated versions to Dokku

Automatic update of Docker image based applications in Dokku

Check updates for Docker images from Docker Hub or private repository, and deploy updated versions to Dokku.

Requirements

  • Bash 4+
  • jq
  • … Dokku, probably? 🤔
/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/bin/java "-Dmaven.multiModuleProjectDirectory=/Users/Milan/Documents/Udemy/Spring Framework 5 Beginner to Guru/sfg-pet-clinic" "-Dmaven.home=/Users/Milan/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/183.4284.118/IntelliJ IDEA 2018.3 EAP.app/Contents/plugins/maven/lib/maven3" "-Dclassworlds.conf=/Users/Milan/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/183.4284.118/IntelliJ IDEA 2018.3 EAP.app/Contents/plugins/maven/lib/maven3/bin/m2.conf" "-javaagent:/Users/Milan/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/183.4284.118/IntelliJ IDEA 2018.3 EAP.app/Contents/lib/idea_rt.jar=50774:/Users/Milan/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/183.4284.118/IntelliJ IDEA 2018.3 EAP.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Users/Milan/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/183.4284.118/IntelliJ IDEA 2018.3 EAP.app/Contents/plugins/maven/lib/maven3/b
import Command
import Console
import Crypto
import Fluent
import FluentSQLite
struct DownloadVideosCommand: Command, Service {
var arguments: [CommandArgument] { return [] }
var options: [CommandOption] { return [] }
var help: [String] { return [] }
protocol Query {
associatedtype QueryType
var codingKey: String { get } // set?
}
private class _AnyQueryBase<QueryType>: Query {
var codingKey: String {
get { fatalError("Must override") }
}