Skip to content

Instantly share code, notes, and snippets.

View adrian-gierakowski's full-sized avatar

Adrian adrian-gierakowski

View GitHub Profile
@robertjpayne
robertjpayne / RCTSwiftBridgeModule.h
Last active January 17, 2024 11:43
React Native - Swift Native Modules
#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"
#define RCT_EXTERN_MODULE(objc_name, objc_supername) \
RCT_EXTERN_REMAP_MODULE(objc_name, objc_name, objc_supername)
#define RCT_EXTERN_REMAP_MODULE(js_name, objc_name, objc_supername) \
objc_name : objc_supername \
@end \
@interface objc_name (RCTExternModule) <RCTBridgeModule> \
self: super:
{
# Install overlay:
# $ mkdir -p ~/.config/nixpkgs/overlays
# $ curl https://gist.githubusercontent.com/LnL7/570349866bb69467d0caf5cb175faa74/raw/3f3d53fe8e8713ee321ee894ecf76edbcb0b3711/lnl-overlay.nix -o ~/.config/nixpkgs/overlays/lnl.nix
userPackages = super.userPackages or {} // {
# Example:
hello = self.hello;
@roberth
roberth / minimod.nix
Last active December 29, 2023 07:47
Simple and quick module system alternative + thoughts and tasks
/*
minimod: A stripped down module system
TODO Comparison:
- [ ] Come up with a benchmark "logic" using plain old functions and let bindings
- [ ] Write the benchmark for the module system
- [ ] Write the benchmark for POP?
- [ ] Qualitative comparison of extensibility in the context of composable
Nixpkgs packaging logic
TODO Fine-tuning:
@SeaJaredCode
SeaJaredCode / README.md
Last active December 2, 2023 07:25
Command line support for getting tokens from Google IAP, with ArgoCD example for working with token.

Overview

The file iap_credentials_helper.sh is broadly applicable to fetch tokens for use by CLI tools that can't navigate Google's IAP via the API.

ArgoCD Wrapper Use

This wrapper is intended to be a very lightweight addition to the standard argocd command. Specifically, removing the need to type `-- header: Bearer ${IAP_TOKEN}" (or similar) onto every command!

with import ./. {};
let
extraSources = [];
lib = pkgs.lib;
optionsListVisible =
lib.filter (opt: opt.visible && !opt.internal)
(lib.optionAttrSetToDocList options);
let _ = global._ = require("lodash");
let Benchmark = global.Benchmark = require("benchmark");
let Promise = require("bluebird");
let { Map } = require("immutable");
let { produce } = require("immer");
function getItems(count) {
let id = 1;
import * as T from "@effect-ts/core/Effect"
import * as S from "@effect-ts/core/Effect/Experimental/Stream"
import * as L from "@effect-ts/core/Effect/Layer"
import * as M from "@effect-ts/core/Effect/Managed"
import * as Q from "@effect-ts/core/Effect/Queue"
import * as SC from "@effect-ts/core/Effect/Schedule"
import { literal, pipe } from "@effect-ts/core/Function"
import { tag } from "@effect-ts/core/Has"
import * as O from "@effect-ts/core/Option"
import type { _A } from "@effect-ts/core/Utils"

nix-bitcoin Setup

0. Concepts

Motivations

Terminology

  • nix - a language
  • nix - a packaging system
#!/bin/bash
set -euo pipefail
# uncomment to debug
# set -x
echo "1️⃣. Does catalina know to create the nix directory?"
if ! grep nix /etc/synthetic.conf > /dev/null 2>&1; then
echo "nix missing from /etc/synthetic.conf. Adding it (will request sudo)"
echo "nix" | sudo tee -a /etc/synthetic.conf > /dev/null
@brainrake
brainrake / deploy.hs
Last active July 15, 2020 06:39
nix-shell shebang haskell turtle nixos deploy script
#! /usr/bin/env nix-shell
#! nix-shell --pure -i runghc -p rsync openssh "haskellPackages.ghcWithPackages (pkgs: [ pkgs.turtle ])"
{-# LANGUAGE OverloadedStrings #-}
import Turtle
import Prelude hiding (FilePath)
import qualified Data.Text as T
sshOpts :: [Text]
sshOpts = ["-o", "StrictHostKeyChecking=accept-new"]