Skip to content

Instantly share code, notes, and snippets.

(import '[java.math MathContext RoundingMode])
(comment
(apply + (last
(transpose
(map (fn [i]
(concat (repeat i 0)
(map (partial * 1.75) (range 1 (- 12 i)))))
(range 11)))))
)
@newmen
newmen / .gitconfig
Created May 13, 2024 16:03
.gitconfig
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
@newmen
newmen / .zsh_aliases
Last active May 13, 2024 14:44
.zsh_aliases
export PATH=$HOME/bin:$PATH:/usr/local/sbin
export PATH=$PATH:$HOME/appengine-java-sdk/bin
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export HISTFILESIZE=5000000
#export HISTCONTROL=ignoredups
export HISTCONTROL=ignoreboth:erasedups
@newmen
newmen / .zshrc
Created May 13, 2024 14:42
.zshrc
# .zshrc
#autoload -Uz compinit && compinit
autoload -U select-word-style
select-word-style bash
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt hist_ignore_all_dups
@newmen
newmen / sfinae.cpp
Last active March 7, 2020 15:52
SFINAE in C++03 and C++11 implementations
#include <iostream>
///////////////////////////////////////////////////////////////////////////////
class Base
{
protected:
Base() {}
public:
private Map<String, Map<String, Map<SchemaInternalOperation, List<SchemaCharge>>>> splitTotal(List<SchemaCharge> charges) {
return MapSeq.map(splitByOffer(charges), (String k, List<SchemaCharge> v) -> {
return MapSeq.map(splitByResource(v), w -> splitByOperation(w));
});
}
private Map<String, List<SchemaCharge>> splitByOffer(List<SchemaCharge> charges) {
return MapSeq.orderedGroupBy(charges, SchemaCharge::getOfferId);
}
package com.odin.rating.application.utils;
import com.odin.rating.application.api.PersistenceHandler;
import reactor.core.publisher.Mono;
import javax.persistence.EntityTransaction;
import java.util.function.Function;
public class TransactionalMono<T> {
private final EntityTransaction transaction;
package ...;
import reactor.core.publisher.Flux;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
(ns ideal.tools.graph)
(defn add-edge
[graph v w]
(update graph v (fnil conj #{}) w))
(defn all-children
[graph key]
(if-let [first-children (get graph key)]
(into #{}
@newmen
newmen / .bash_aliases.sh
Last active June 15, 2016 17:00
my aliases and sublime settings
export HISTFILESIZE=100000
export HISTCONTROL=ignoredups
export GCC_PATH=/usr/local/Cellar/gcc/5.3.0
export CXX=${GCC_PATH}/bin/g++-5
# REMOVE IT WHEN YOU LEAVE FROM ODIN
odin_env=$HOME/.odin_env
[[ -e $odin_env ]] && source $odin_env