Skip to content

Instantly share code, notes, and snippets.

View siers's full-sized avatar
:octocat:

Raitis Veinbahs siers

:octocat:
View GitHub Profile
@nicerobot
nicerobot / chrome-cookies.sh
Created December 7, 2011 16:59
Convert Google Chrome sqlite Cookies into cookies.txt. Useful for utilities like curl.
sqlite3 -separator ' ' ${COOKIES:-Cookies} \
'select host_key, "TRUE", path, "FALSE", expires_utc, name, value from cookies'
@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] = {
@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";
@jfmengels
jfmengels / lodash-fp-documentation.md
Last active February 6, 2024 20:57
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs
@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 February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@travisbhartwell
travisbhartwell / nix-shell-shebang.md
Last active March 29, 2024 19:55
nix-shell and Shebang Lines

NOTE: a more up-to-date version of this can be found on my blog

nix-shell and Shebang Lines

A few days ago, version 1.9 of the Nix package manager was released. From the release notes:

nix-shell can now be used as a #!-interpreter. This allows you to write scripts that dynamically fetch their own dependencies.

bind-key C-b send-prefix
bind-key C-o rotate-window
bind-key C-z suspend-client
bind-key Space next-layout
bind-key ! break-pane
bind-key " split-window
bind-key # list-buffers
bind-key $ command-prompt -I #S "rename-session '%%'"
bind-key % split-window -h
bind-key & confirm-before -p "kill-window #W? (y/n)" kill-window