Skip to content

Instantly share code, notes, and snippets.

Mariusz Nosiński marioosh

Block or report user

Report or block marioosh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
marioosh /
Created Mar 28, 2011
Devise polish translation, for version 1.2 and up
# Works with devise 1.2 rails 3 (rails 2 not tested)
not_found: "nie znaleziono"
already_confirmed: "już został aktywowany"
not_locked: "nie był zablokowany"
one: "%{resource} nie został zapisany z powodu jednego błędu:"
marioosh /
Created Jul 11, 2013
Test for delete verticies in orientDB 1.4.1
import com.orientechnologies.orient.core.sql.OCommandSQL;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.orient.OrientGraph;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
package sudoku;
import solver.Solver;
import solver.constraints.IntConstraintFactory;
import solver.variables.IntVar;
import solver.variables.VariableFactory;
marioosh /
Created Feb 24, 2014
Grid class for sudoku solver
package sudoku;
* Created with IntelliJ IDEA.
* User: marioosh
* Date: 23.02.2014
* Time: 21:34
public class Grid {
marioosh / Sample.scala
Last active Aug 29, 2015
String interpolation example
View Sample.scala
object Sample {
def main(args: Array[String]) {
println(xX"!dlrow olleh")
implicit class xXHelper(val sc: StringContext) extends AnyVal {
def xX(args: Any*): String =
marioosh / pre_push
Created Dec 23, 2014
executing test before push to remote server
View pre_push
CMD="sbt clean cleanFiles test"
echo ""
echo ">> You do not pass if any from tests will fail"
echo ""
if [$RESULT -ne 0 ]; then
View personal_fish_prompt
# name: MyAgnoster - agnoster based theme, added behind and ahead commits amount
# agnoster's Theme -
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](
## Set this options in your (if you want to :])
# set -g theme_display_user yes
marioosh / ChatRoom.scala
Last active Mar 8, 2018
websocket based on akka-http
View ChatRoom.scala
class ChatRoom(roomId: Int, actorSystem: ActorSystem) {
private[this] val chatRoomActor = actorSystem.actorOf(Props(classOf[ChatRoomActor], roomId))
def websocketFlow(user: String): Flow[Message, Message, _] = ???
def sendMessage(message: ChatMessage): Unit = chatRoomActor ! message
marioosh / Flows.scala
Last active Dec 8, 2015
View Flows.scala
val source = Source(1 to 10)
val sink = Sink.fold[String, String]("")(_ + _)
val flow = Flow[Int]
.filter(_ % 2 == 0)
val result = source.via(flow).runWith(sink) //Future[String]
marioosh / Server.scala
Created May 20, 2016
Basic akka-http server
View Server.scala
package io.scalac.conductr.example
import akka.http.scaladsl.Http
import akka.http.scaladsl.server.Directives._
import{Sink, Source}
import scala.concurrent.duration._
import scala.concurrent.{Await, Future}
You can’t perform that action at this time.