Skip to content

Instantly share code, notes, and snippets.

@ravloony
ravloony / falcon-default.nix
Last active July 21, 2023 14:12
Falcon package
{ stdenv, dpkg, fetchurl, openssl, libnl, buildFHSUserEnv,... }:
stdenv.mkDerivation {
name = "falcon-sensor";
version = "4.18.0-6402";
arch = "amd64";
src = fetchurl {
url = "https://storage.googleapis.com/company-tools/falcon-sensor/falcon-sensor_4.18.0-6402_amd64.deb";
sha512 = "dc41cfe0232124480abdcf456df9a3bd6cab62716bc5beea089fbf99ac2e29bf1e1a44676591a71eeb35afe7f25e495b53ede007cfc15dcbf47df7ec0a016098";
};
@ravloony
ravloony / max_profit.purs
Last active January 16, 2018 21:10
You have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
module Main where
import Prelude
import Control.MonadPlus (guard)
import Control.Monad.Eff.Console (logShow)
import Data.Array ((..), length, index)
import Data.List (List(..), (:), fromFoldable)
import Data.Tuple (Tuple, fst, snd)
import Data.Foldable (for_)
import Data.Maybe (fromMaybe)
@ravloony
ravloony / dedupecp.sh
Last active October 26, 2017 19:29
When passed a source dir and a target dir, this script will check by filename for each file in the source dir, whether it exists in the target dir. If not, it will move it to the target dir. If it exists, it verifies via sha256sum that the content is the same. If the content is the same it will delete the source file. Useful for when you have a …
#!/usr/bin/env bash
SRC=$1
DEST=$2
echo "cp from $SRC to $DEST"
function hash ()
{
local __resultvar=$1
@ravloony
ravloony / package.json
Last active December 13, 2018 06:33
Purescript webpack config
{
"name": "something",
"version": "0.0.1",
"description": "Something",
"main": "bundle.js",
"directories": {
"test": "test"
},
"dependencies": {
},

Keybase proof

I hereby claim:

  • I am ravloony on github.
  • I am ravloony (https://keybase.io/ravloony) on keybase.
  • I have a public key whose fingerprint is 52D8 CA4A 6BDD 9181 A270 DCB1 707C 72FF 8599 3146

To claim this, I am signing this object: