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 kotlin.reflect.full.findAnnotation | |
import kotlin.reflect.full.memberProperties | |
@Target(AnnotationTarget.PROPERTY) | |
annotation class JsonFileId | |
interface JsonSerializable | |
fun JsonSerializable.serialize(): String { |
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
(ns learnclojure.core | |
(require [clojure.core.async :as async :refer [thread]] | |
[clojure.data.json :as json] | |
[clojure.core.match :refer [match]]) | |
(use [clojure.string :as strings :only [includes? | |
lower-case | |
index-of | |
split | |
triml | |
starts-with? |
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
fs.inotify.max_user_watches = 83886080 | |
vm.vfs_cache_pressure = 50 | |
vm.swappiness = 0 | |
vm.dirty_ratio = 60 | |
vm.dirty_background_ratio = 2 | |
net.ipv4.tcp_timestamps = 0 | |
net.core.netdev_max_backlog = 250000 | |
net.core.rmem_max = 83886080 | |
net.core.wmem_max = 83886080 | |
net.core.rmem_default = 83886080 |
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 main | |
import "fmt" | |
type ListNode struct { | |
Val int | |
Next *ListNode | |
} | |
func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode { |
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 java.math.BigDecimal | |
import java.util.* | |
inline fun <T> Iterable<T>.sumByPrice(selector: (T) -> Price): Price { | |
return this.fold(Price.identity) { a: Price, b: T -> a + selector(b) } | |
} | |
inline fun <T> Iterable<T>.sumByWeight(selector: (T) -> Weight): Weight { | |
return this.fold(Weight.identity) { a: Weight, b: T -> a + selector(b) } | |
} |
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
inline fun <T> Iterable<T>.sumByPrice(selector: (T) -> Price): Price { | |
return this.map(selector).reduce({acc: Price, price: Price -> acc + price }) | |
} | |
inline fun <T> Iterable<T>.sumByWeight(selector: (T) -> Weight): Weight { | |
return this.map(selector).reduce({acc: Weight, weight: Weight -> acc + weight }) | |
} | |
data class Price(private val value: BigDecimal) { | |
operator fun plus(price: Price) = Price(this.value + price.value) |
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
<?xml version='1.0'?> | |
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> | |
<fontconfig> | |
<match target="pattern"> | |
<edit mode="assign" name="dpi"> | |
<double>96</double> | |
</edit> | |
</match> | |
<match target="font"> | |
<edit mode="assign" name="autohint"> |
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
#include <math.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#ifndef COEFF_ARR_SIZE | |
#define COEFF_ARR_SIZE 8 | |
#endif | |
float a0, a1, a2, a3, b1, b2, left_corner, right_corner; |
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
# | |
# Automatically generated file; DO NOT EDIT. | |
# Linux/x86 4.10.1-gentoo Kernel Configuration | |
# | |
# | |
# Gentoo Linux | |
# | |
CONFIG_GENTOO_LINUX=y | |
CONFIG_GENTOO_LINUX_UDEV=y |
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
#!/bin/sh | |
if [[ -f /var/cache/.restored ]] | |
then | |
rsync -avzh -x /var/cache/ /usr/portage/local/cache > /dev/null 2>/var/log/cache-store.log | |
fi |