Skip to content

Instantly share code, notes, and snippets.

wpaHook.connectHook = ''
case "$(${pkgs.wpa_supplicant}/bin/wpa_cli status | grep bssid | cut -d'=' -f2)" in
"ae:0d:1b:e7:e9:f9")
${pkgs.iproute}/bin/ip addr add 192.168.43.2/24 dev wlp2s0
${pkgs.iproute}/bin/ip route add default via 192.168.43.1
;;
*)
${pkgs.dhcpcd}/bin/dhcpcd -1 wlp2s0
;;
esac
wpaHook.enable = true;
wpaHook.disconnectHook = ''
${pkgs.iproute}/bin/ip addr flush dev wlp2s0
${pkgs.iproute}/bin/ip route flush dev wlp2s0
'';
wpaHook.connectHook = ''
case "$(${pkgs.wpa_supplicant}/bin/wpa_cli status | grep bssid | cut -d'=' -f2)" in
"ae:0d:1b:e7:e9:f9")
rec {
foo = xs: p: let
sorted = builtins.sort (x: y: x.startMin < y.startMin) xs;
in map ({fst, snd}: p fst snd) (super.lib.zipLists sorted (builtins.tail sorted));
verifyTime = times: foo times (x: y: x.startMin + x.lenMin <= y.startMin);
}
nix-repl> a = builtins.readFile "${runCommandNoCC "a" {} "echo a > $out"}"
nix-repl> a
[1 built (1 failed), 0.0 MiB DL] querying info about missing paths"a\n"
nix-repl> a
"a\n"
#include <stdio.h>
int main()
{
int sum = 0;
for(int i = 6; i <= 66; i += 2)
{
i += sum;
}
Require Import ZArith_base.
Require Import ZArith.BinInt.
Require Import Classes.RelationClasses.
Require Import Omega.
Local Open Scope Z_scope.
Definition Divisible (x n : Z) : Prop := exists (k : Z), k*n = x.
Definition Modulo (n x y : Z) : Prop := Divisible (x - y) n.
Notation "( x == y ) 'mod' n" := (Modulo n x y) (at level 50).
Require Import ZArith_base.
Require Import ZArith.BinInt.
Require Import Omega.
Local Open Scope Z.
Definition Even (x : Z) := exists (k : Z), x = 2*k.
Definition Odd (x : Z) := exists (k : Z), x = 2*k + 1.
Theorem even_plus_even : forall (x y : Z), Even x -> Even y -> Even (x + y).
axiom([A | _], [A | _]).
andLL([and(A, _) | Gamma], Delta) :- solve([A | Gamma], Delta).
andLR([and(_, B) | Gamma], Delta) :- solve([B | Gamma], Delta).
andI(Gamma, [and(A, B)]) :-
solve(Gamma, [A]),
solve(Gamma, [B]).
orLL(Gamma, [or(A, _) | Delta]) :- solve(Gamma, [A | Delta]).
orLR(Gamma, [or(_, B) | Delta]) :- solve(Gamma, [B | Delta]).
const app = new Vue({
el: '#app',
data: {
handle: null,
handleColor: '#F1F1F1',
handleStrokeColor: '#333333',
handleStrokeWidth: 2,
resizeHandleRadius: 4,
rotateHandleRadius: 6,
activeStrokeColor: 'black',
#include"common.h"
#include<stdio.h>
#include<stddef.h>
void prompt_( char *prompt, char *dest, size_t count )
{
fprintf(stderr, "%s ", prompt);
char ch;