Skip to content

Instantly share code, notes, and snippets.

@jb55
jb55 / default.nix
Last active July 30, 2023 21:45
deploy dotnet core apps on nixos
{ stdenv, lib, bash, callPackage, writeText, makeWrapper, writeScript, dotnet-sdk,
patchelf, libunwind, coreclr, libuuid, curl, zlib, icu }:
let
config = "Staging";
project = "RazorCx.Api";
target = "linux-x64";
rpath = stdenv.lib.makeLibraryPath [ libunwind coreclr libuuid stdenv.cc.cc curl zlib icu ];
@jb55
jb55 / pdfnow
Last active November 25, 2019 16:47
#!/usr/bin/env bash
PANDOC="pandoc --variable urlcolor=cyan"
usage () {
printf "usage: pdfnow file.md OR <file.md pdfnow markdown\n" >&2
exit 1
}
[ $# -eq 0 ] && usage
@jb55
jb55 / gist:2253102
Created March 30, 2012 17:20
Lambda and arrow digraphs in vim
" lambda λ
imap <C-j> <C-k>l*
" right arrow →
imap <C-l> <C-k>->
" left arrow ←
imap <C-h> <C-k><-
" compose ∘
var uid = require('uid');
var data = require('data');
function hash(el) {
var d = data(el);
var hash = d.get('mylib:uid');
if (hash) return hash;
var id = uid();
d.set('mylib:uid', id);
return id;
@jb55
jb55 / rsa-acc.js
Created June 24, 2019 00:38 — forked from syuhei176/rsa-acc.js
RSA accumulator
const primeNumberList = require('prime-number/list')
const BigNumber = require('bignumber.js');
const utils = require('ethereumjs-util');
// const primeNumberList = [3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47];
BigNumber.config({
DECIMAL_PLACES: 2,
ROUNDING_MODE: BigNumber.ROUND_FLOOR
})
@jb55
jb55 / keybase.md
Created May 11, 2019 04:02
keybase high security key

Keybase proof

I hereby claim:

  • I am jb55 on github.
  • I am jb55 (https://keybase.io/jb55) on keybase.
  • I have a public key whose fingerprint is 5B2B 1E4F 6221 6BC7 4362 AC61 D4FB A2FC 4535 A2A9

To claim this, I am signing this object:

@jb55
jb55 / main.rs
Created September 1, 2018 18:10
extern crate actix_web;
extern crate serde;
extern crate futures;
#[macro_use]
extern crate serde_derive;
mod activitypub;
#[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]
pub enum LinkOr<T> {
Link(String),
NotLink(T)
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]
@jb55
jb55 / main.rs
Created September 1, 2018 00:36
use std::io::prelude::*;
use std::net::TcpListener;
use std::net::TcpStream;
use std::io;
extern crate httparse;
fn main() {
let bind = "127.0.0.1";