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
add_newline = false | |
[character] | |
success_symbol = "[😍 ](bold green) " | |
error_symbol = "[😵 ](bold red) " | |
[[battery.display]] | |
threshold = 10 | |
style = "bold red" |
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
-- This file can be loaded by calling `lua require('plugins')` from your init.vim | |
-- Only required if you have packer configured as `opt` | |
vim.cmd [[packadd packer.nvim]] | |
return require('packer').startup(function() | |
-- Packer can manage itself | |
use 'wbthomason/packer.nvim' | |
use "EdenEast/nightfox.nvim" -- Packer |
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
require('plugins') | |
vim.o.number=true | |
vim.o.expandtab=true | |
vim.o.smartindent=true | |
vim.o.softtabstop=2 | |
vim.o.encoding="utf-8" | |
vim.o.fileencodings="utf-8,cp932" | |
vim.o.clipboard="unnamed,unnamedplus" | |
vim.o.shiftwidth=2 |
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
defmodule Etc do | |
def hello do | |
IO.puts "Hello" | |
end | |
def return_ok do | |
{:ok, "ok"} | |
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
def uncurry[A, B, C](f: A => B => C): (A, B) => C = { | |
// (A, B) => C なので、まずは (a, b) を受ける | |
// a, b を受けたら C を返せば良い。 | |
// Cを返すためには 引数として受け取っている f に適用すれば良い | |
// f: A => B => C なので f(a, b) とすることは出来ないため | |
// f(a)(b)の部分適用とする | |
// f(a)(b) は C を返す | |
(a, b) => f(a)(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
object Main extends App { | |
// your code goes here | |
def fib(n: Int): Int = { | |
@annotation.tailrec | |
def loop(count: Int, pp: Int, p: Int): Int = { | |
// println(s"n: $n, count: $count, pp: $pp, p: $p") | |
if(count < n - 2) { | |
loop(count + 1, p, p + pp) | |
} else { | |
pp + p |
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
/* sbt */ | |
name := "packetCapture" | |
version := "1.0" | |
scalaVersion := "2.11.4" | |
libraryDependencies ++= Seq( | |
"org.pcap4j" % "pcap4j-core" % "1.3.0", | |
"org.pcap4j" % "pcap4j-packetfactory-static" % "1.3.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
/** | |
* Created by FScoward on 15/01/18. | |
*/ | |
object Luhn { | |
/** | |
* Luhn algorithm | |
* */ | |
def isValid(s: String): Boolean = { | |
val list = doubleOddValues(toReverseIntList(s)) |