Skip to content

Instantly share code, notes, and snippets.

View salanki's full-sized avatar

Peter Salanki salanki

View GitHub Profile
@salanki
salanki / pixelstream-temple-ksvc.yaml
Last active April 22, 2023 08:58
KNative Service for Unreal Engine Pixelstream
# On how to build the pixelstreaming images yourself: https://adamrehn.com/articles/pixel-streaming-in-linux-containers/
# and https://github.com/adamrehn/ue4-example-dockerfiles/tree/master/pixel-streaming. All images used in this YAML are public.
# Developed for Bare Metal Managed Kubernetes GPUs from http://www.coreweave.com
# Will work locally without any additional components if POD CIDRs are reachable from the clients computer. To work from the Internet, a STUN/TURN server needs to be setup. Hit me up for more info on that.
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: ue4-temple
spec:
@salanki
salanki / folding-at-home-deployment.yaml
Created March 11, 2020 00:17
Folding @ Home GPU Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: folding-at-home
spec:
progressDeadlineSeconds: 25920000
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:

Keybase proof

I hereby claim:

  • I am salanki on github.
  • I am salanki (https://keybase.io/salanki) on keybase.
  • I have a public key ASCUTCgXmhpAZAGEASjr0WsQkx8a8xjqoaQiZF9lhfwvDgo

To claim this, I am signing this object:

@salanki
salanki / render-example.yaml
Last active October 25, 2019 18:45
For Brian
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: render-123-classroom
spec:
maxParallelism: 50 # Run maximum 50 tasks in parallel
retryStrategy:
limit: 2 # Retry each task max twice
entrypoint: render
templates:
@salanki
salanki / activerecord.md
Last active February 7, 2018 06:52
Performance effects of subtly different ActiveRecord methods

Checking for existance

TL;DR

Use exists?

exits?

Ruby:

// lib/actions.js
import identity from 'lodash/identity';
export const ActionType = {
REQUEST: 'REQUEST',
SUCCESS: 'SUCCESS',
FAILURE: 'FAILURE'
};
function createActionCreatorFlat(prefix, type, requestPayloadCreator = identity) {
function generator(baseType) {
// Need to handle variable length argument lists
const fun = (payload) => ({
type: fun,
payload: payload,
baseType: baseType
});
return fun;
}
/* Actions.scala */
package actions
trait Action // Trait ~= abstract class / interface. Can't be directly instantiated.
sealed trait Feed extends Actions // Sealing is not required but important as the compiler will know that this class can't be extended by any other code, meaning we can do static typechecking that anything that is supposed to handle all cases of Feed actually does so. More reading: http://underscore.io/blog/posts/2015/06/02/everything-about-sealed.html
/* Objects are often used similar to packages in Scala. In this case you can just think of them as a grouping, no other special meaning */
object Feed {
class FetchRequest extends Feed
@salanki
salanki / coproductEncoder.scala
Last active August 26, 2022 00:39
Coproduct Encoder for Argonaut
import shapeless.{Poly1, Coproduct}
import shapeless.ops.coproduct.Folder
import argonaut.{_}
import argonaut.Argonaut._
/**
* Generic encoder for Coproducts, will only resolve if all types in a Coproduct has an EncodeJson in scope
*/
object CoproductToArgonautFolder extends Poly1 {
@salanki
salanki / gist:8609177
Last active August 27, 2023 16:52 — forked from ceedubs/gist:8589661
import scalaz._
import Scalaz._
import scala.concurrent.Future
import scalaz.contrib.std.scalaFuture._ // typeclass instances for Scala Future
import scala.concurrent.ExecutionContext.Implicits.global // implicit execution context...you probably want a better one for real-world
type ErrorsOrT[M[+_], +A] = EitherT[M, NonEmptyList[String], A] // String could be your error type of choice
for {
thing1 <- EitherT(Future.successful(1.right))