Skip to content

Instantly share code, notes, and snippets.

View maizy's full-sized avatar
🕊️
-

Nikita Kovalev maizy

🕊️
-
View GitHub Profile
@maizy
maizy / init.lua
Created February 19, 2021 09:19
Hammerspoon global search hotkey for Bitwarden
-- file: ~/.hammerspoon/init.lua
-- https://www.hammerspoon.org/
--
-- Bring Bitwarden to front and focus on search field
-- Required accessability to be enabled in Hammerspoon & System preferences
function launch_bitwarden_search()
hs.application.launchOrFocus("Bitwarden")
local app = hs.appfinder.appFromName("Bitwarden")
if (app ~= nil) then
local activated = app:activate(true)
@maizy
maizy / main.go
Created January 4, 2021 11:14
git interface & struct embedding
package main
import "fmt"
type Resulter interface {
GetResult() string
}
type DefaultResulter struct {
Resulter
@maizy
maizy / minetest-5.0.md
Created April 6, 2019 09:24
minetest 5.0 on macOS

minetest 5.0 on macOS

Based on homebrew formula

Build

Build dependencies:

brew install freetype gettext irrlicht jpeg libogg libvorbis luajit cmake

import scala.annotation.tailrec
@tailrec
def nextStep(
iter: Iterator[Int], someAcc: List[Int]): (Stream[Int], Iterator[Int], List[Int]) = {
if (iter.hasNext) {
val i = iter.next()
// emulate some window function computation
val newAcc = (i / 2) :: someAcc
val windowValue = newAcc.sum
[info] +-com.typesafe.play:play-ahc-ws-standalone_2.11:1.0.0-M4 [S]
[info] | +-com.typesafe.play:cachecontrol_2.11:1.1.2 [S]
[info] | | +-joda-time:joda-time:2.7 (evicted by: 2.9.6)
[info] | | +-joda-time:joda-time:2.9.6
[info] | | +-org.joda:joda-convert:1.7
[info] | | +-org.scala-lang.modules:scala-parser-combinators_2.11:1.0.5 [S]
[info] | | +-org.slf4j:slf4j-api:1.7.22
[info] | |
[info] | +-com.typesafe.play:play-ws-standalone_2.11:1.0.0-M4 [S]
[info] | | +-com.typesafe.akka:akka-stream_2.11:2.4.14 [S]
@maizy
maizy / README.md
Last active December 10, 2015 13:55
python cli encoding
$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
@maizy
maizy / letter.txt
Last active October 27, 2015 07:37
письмо счастья (выужено из спама)
Dr. Harry Thomas <acct.contfarmkalimantan@___.com>
Д-р Томас Гарри Brondesbury, Северо-Запад Лондон, Англия
Дорогой друг.
Я доктор Гарри Томас из Brondesbury, Северо-Запад Лондон, здесь, в Англии. Я
работаю на UBS Investment Bank London. Я пишу вам о бизнес-предложение,
которое будет из огромную пользу для нас обоих. В моем отделе, в качестве
// file: src/multi-jvm/scala/SupervisortClusterEventsSpec.scala
//
// Required properly multi-jvm setup:
// http://doc.akka.io/docs/akka/snapshot/scala/cluster-usage.html#How_to_Test
//
// based on example from akka docs
import scala.collection.mutable
import scala.concurrent.duration._
import org.scalatest.{ Suite, BeforeAndAfterAll, FlatSpecLike, Matchers }
@maizy
maizy / node.md
Created August 12, 2015 10:48
install node v0.10.36 with brew in os x
cd /usr/local/Library/Formula
brew remove node --force
git checkout b64d9b9c431642a7dd8d85c8de5a530f2c79d924
brew install node
git checkout master

based on https://gist.github.com/mpesic/3759330

@maizy
maizy / repl.txt
Created June 1, 2015 16:16
Anonymous func from method with implicit params?
$ scala
Welcome to Scala version 2.11.5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_67).
Type in expressions to have them evaluated.
Type :help for more information.
scala> class MyContext2(val m: Int)
defined class MyContext2
scala> object TestObj2{ def withImp(s: String)(implicit c: MyContext2): String = s"c:${c.m}" }
defined object TestObj2