This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# PROVIDE: my_app | |
# REQUIRE: networking | |
# KEYWORD: | |
. /etc/rc.subr | |
name="my_app" | |
rcvar="${name}_enable" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################### | |
# Bazik ZSH theme # | |
################### | |
# Colored ls | |
# a black | |
# b red | |
# c green | |
# d brown | |
# e blue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Let’s say we have a word list. | |
let word_list: Vec<String> = ...; | |
// We want to generate a random passphrase using words from the list. | |
// Let’s see how to do this with equal performance in two different styles: | |
// procedural and functional Rust. | |
// In both cases we need a random generator. | |
let mut rng = rand::thread_rng(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; test_loop::sum_manual | |
; Function Attrs: noinline uwtable | |
define internal fastcc void @_ZN9test_loop10sum_manual17h519a3902bc8dc8acE(%"alloc::string::String"* noalias nocapture dereferenceable(24), i64** dereferenceable(8) %rng, i8 %n) unnamed_addr #5 { | |
start: | |
%sum = alloca i32, align 4 | |
%1 = bitcast i32* %sum to i8* | |
call void @llvm.lifetime.start(i64 4, i8* nonnull %1) | |
store i32 0, i32* %sum, align 4 | |
%2 = icmp eq i8 %n, 0 | |
br i1 %2, label %bb2, label %bb3.preheader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Fixtures do | |
def user do | |
quote do | |
def user, do: :user | |
end | |
end | |
def client do | |
quote do | |
# You can use fixtures recursively. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
let | |
elixir_1_7_0_rc_1 = { mkDerivation }: | |
mkDerivation rec { | |
version = "1.7.0-rc.1"; | |
# Use `nix-prefetch-github --rev <version> elixir-lang elixir` to update. | |
sha256 = "1hp1zdscq7h2qcgcfbzw5dx1wxy05bqlrxvv5kcl8414c69inx8g"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
let | |
inherit (lib) optional optionals; | |
erlangDrv = { mkDerivation }: | |
mkDerivation rec { | |
version = "21.0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################### | |
# Environment setup for Nix shells # | |
#################################### | |
# From https://github.com/direnv/direnv/wiki/Nix#persistent-cached-shell | |
# | |
# Usage: use_nix [...] | |
# | |
# Load environment variables from `nix-shell`. | |
# If you have a `default.nix` or `shell.nix` one of these will be used and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
let | |
# I like to define variables for derivations that have | |
# a specific version and are subject to change over time. | |
elixir = beam.packages.erlangR21.elixir_1_7; | |
in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
let | |
inherit (lib) optional optionals; | |
elixir = beam.packages.erlangR21.elixir_1_7; | |
in | |
mkShell { |
OlderNewer