Skip to content

Instantly share code, notes, and snippets.

@ppurang
ppurang / README.md
Last active June 19, 2024 11:42 — forked from keynmol/README.md
Scala example of using htmx
@ppurang
ppurang / build.sbt
Created October 4, 2019 12:32 — forked from channingwalton/build.sbt
Scala 2.13 compiler flags
val scalacOptions ++= Seq(
"-encoding",
"utf-8", // Specify character encoding used by source files.
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-explaintypes", // Explain type errors in more detail.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
"-language:higherKinds", // Allow higher-kinded types
"-language:implicitConversions", // Allow definition of implicit functions called views
@ppurang
ppurang / installation.md
Created March 25, 2019 08:48 — forked from natbusa/installation.md
Dell XPS for Ubuntu 18.04

Dell XPS for Ubuntu 18.04

Bios:

press F12 on the Dell startup screen

  • disable safe boot
  • Change SATA Operation from "RAID On" to "AHCI"
  • Enable Legacy Boot as well as UEFI

Install Ubuntu from USB drive

Instructions are here: https://www.ubuntu.com/download/desktop

@ppurang
ppurang / LandingFestival Berlin 2018 CFP.md
Last active January 24, 2018 20:41
Pitch for LandingFestival Berlin 2018

#CallForSpeakers pitch for #LandingFestival Berlin 2018

Considered leveraging your technical debt?

Description

How often do you hear the term MVP (minimum viable product) bandied around in startup land? It’s often a necessary evil. Technical debt, or the implied cost of the additional work caused by choosing an easy option now, rather than opting for a better solution which may take more time, is commonplace in almost every engineering team and its products. As engineers, we need to aggressively manage our technical debt, but also open our eyes to the opportunity it can provide. It’s akin to financial leverage, and has future value.

Key takeaway

I'll debunk the myths around technical debt, share how to aggressively manage it, and how to leverage it for the good of the product, the team, the company and the end user.

@ppurang
ppurang / charscounter.scala
Last active August 29, 2015 14:07
count chars in a file
// see also http://piyush.purang.net/blog/Reading_Type_Signatures_5e999531-595f-4348-b44c-e239be962885
import java.io.File
// following is the goal
type CountCharsInAFile = String => Int
type PathToFile = String => File
def pathToFile : PathToFile = new File(_)
type FileToLines = File => List[String]
@ppurang
ppurang / build.sbt
Last active August 29, 2015 13:56
sbt prompt with git branch and git status for modifications etc.
// the following results in
// superduperproject : master : 0.1.0 : MD??>
// where M => Modified, D => Deleted, ?? => not tracked
// and might include (not tested :))
// !, R, C, U for details check https://www.kernel.org/pub/software/scm/git/docs/git-status.html#_short_format
// if you see superduperproject : master : 0.1.0 : -?-> ... well then oops and happy debugging and do tell...
shellPrompt in ThisBuild := ShellPrompt.buildShellPrompt("0.1.0")
/*
* Copyright (c) 2012, Lawrence Livermore National Security, LLC. Produced at
* the Lawrence Livermore National Laboratory. Written by Keith Stevens,
* [email protected] OCEC-10-073 All rights reserved.
*
* This file is part of the S-Space package and is covered under the terms and
* conditions therein.
*
* The S-Space package is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
import akka.actor.Actor.Receive
import akka.actor.ActorContext
import akka.actor.ActorLogging
import akka.actor.Actor
import akka.event.LoggingAdapter
object MyLoggingReceive {
def apply(log: LoggingAdapter)(r: Receive)(implicit context: ActorContext): Receive = r match {
case _: MyLoggingReceive ⇒ r
@ppurang
ppurang / gist:6864736
Created October 7, 2013 08:57
getFileExtension from You Can't JavaScript Under Pressure
//caution this is a very bad idea for a function even in javascript!
function getFileExtension(i) {
// i will be a string, but it may not have a file extension.
// return the file extension (with no period) if it has one, otherwise false
var x;
if(i.lastIndexOf(".") > -1)
x = i.substring(i.lastIndexOf(".")+1, i.length);