Skip to content

Instantly share code, notes, and snippets.

View siers's full-sized avatar
:octocat:

Raitis Veinbahs siers

:octocat:
View GitHub Profile
@siers
siers / flake.nix
Last active October 11, 2023 08:05
printing out a lamb
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-23.05";
};
outputs = { self, nixpkgs }:
with nixpkgs.legacyPackages.x86_64-linux;
let
system = "x86_64-linux";
@guizmaii
guizmaii / GroupableOps.scala
Created April 16, 2019 13:22 — forked from fernandomora/GroupableOps.scala
Scala groupMap from 2.13 for scala 2.12
import scala.collection.{immutable, mutable, GenTraversableOnce}
import scala.collection.generic.CanBuildFrom
object GroupableOps {
implicit class ToGroupable[A, Coll[X] <: GenTraversableOnce[X]](coll: Coll[A]) {
// https://github.com/scala/scala/blob/v2.13.0-M5/src/library/scala/collection/Iterable.scala#L578
def groupMap[K, B, To](key: A => K)(f: A => B)
(implicit bf: CanBuildFrom[Coll[A], B, To]): immutable.Map[K, To] = {
let g:ctrlp_map = ''
function! CtrlP()
if (getcwd() == $HOME)
echo "Won't run in ~"
return
endif
if (getcwd() == '/')
echo "Won't run in /"
return
@emmanuelrosa
emmanuelrosa / myriad-pro-font.nix
Last active September 10, 2020 16:48
Nix package for Myriad Pro font
{ stdenv, fetchurl }:
let
fetchfont = name: num: sha:
fetchurl {
url = "https://fontsup.com/download/${builtins.toString num}.html";
sha256 = sha;
name = "${name}";
};
in stdenv.mkDerivation rec {
#include <stdio.h>
#include <stdint.h>
#define MAX 100
int
main(int argc, char **argv)
{
intptr_t op[MAX + 2];
int ip;
@oriadam
oriadam / colorValues.js
Last active February 9, 2024 16:01
javascript convert any color to array of rgba values
// return array of [r,g,b,a] from any valid color. if failed returns undefined
function colorValues(color)
{
if (!color)
return;
if (color.toLowerCase() === 'transparent')
return [0, 0, 0, 0];
if (color[0] === '#')
{
if (color.length < 7)
@joyrexus
joyrexus / README.md
Last active November 27, 2024 13:58
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@creichert
creichert / fetch-url.hs
Last active January 9, 2020 19:39
Customize haskell http-client supported TLS ciphers
#!/usr/bin/env stack
-- stack -v runghc --package connection --package http-client --package http-client-tls --package tls --package data-default
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -fno-warn-deprecations #-}
import qualified Network.Connection as NC
import qualified Network.HTTP.Client as Http
import qualified Network.HTTP.Client.TLS as Http
import qualified Network.TLS as TLS
@codepr
codepr / Actor.scala
Last active May 5, 2021 21:10
Basic hello world cluster server
package clusterserver
import akka.actor._
class Logger extends Actor with ActorLogging {
log.info("Logger started!")
def receive = {
case msg => log.info("Got msg: {}", msg)
}
@jfmengels
jfmengels / lodash-fp-documentation.md
Last active July 25, 2024 05:02
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs