This file contains hidden or 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
use std::cmp; | |
/// Position within a line | |
pub type Pos = usize; | |
/// Text zipper | |
pub struct Zip<'a> { | |
/// Lines before the current line | |
prev: Vec<&'a str>, |
This file contains hidden or 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
pub fn toString(&self) -> String { | |
self.up.push(& self.cur); | |
self.up.extend(self.down.into_iter()); | |
self.up.join("\n") | |
} |
This file contains hidden or 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
pub mod text; | |
use text::zip::fromString; | |
use text::zip::toString; | |
fn main() { | |
println!("{}", fromString("a").toString()) | |
} |
This file contains hidden or 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
# Generated by iptables-save v1.6.2 on Mon Jul 9 10:34:48 2018 | |
*nat | |
:PREROUTING ACCEPT [1742:117923] | |
:INPUT ACCEPT [1740:117217] | |
:OUTPUT ACCEPT [32:2676] | |
:POSTROUTING ACCEPT [32:2676] | |
COMMIT | |
# Completed on Mon Jul 9 10:34:48 2018 | |
# Generated by iptables-save v1.6.2 on Mon Jul 9 10:34:48 2018 | |
*raw |
This file contains hidden or 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
eval $(xdotool getmouselocation --shell) | |
while :; do | |
XOLD=$X | |
YOLD=$Y | |
eval $(xdotool getmouselocation --shell) | |
[ $(( XOLD - X )) -gt 10] && echo "Down swipe" | |
sleep 0.1 | |
done |
This file contains hidden or 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
nixops create ./ops/config.nix ./ops/ec2.nix -d deployment |
This file contains hidden or 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, ... }: | |
{ | |
imports = [ { nix.binaryCachePublicKeys = [ "uwu" ]; } ]; | |
boot.loader.grub.enable = false; | |
fileSystems."/".device = "x"; | |
nixpkgs.config.overlays = self: super: { | |
bootstrapFiles = {}; | |
stdenv = super.stdenv // { | |
# bootstrapTools = abort "blargh"; |
This file contains hidden or 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
string = "s7 test" | |
for k, v in string.gmatch(string, "(%S+)%s(%S+)") do | |
_G[k] = v | |
end | |
print(s7) |
This file contains hidden or 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
string = "s7 test" | |
for k, v in string.gmatch(string, "(%S+)%s(%S+)") do | |
_G[k] = v | |
end | |
print(s7) |
This file contains hidden or 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
-- | This file is part of AdrianParvin. | |
-- | | |
-- | AdrianParvin is free software: you can redistribute it and/or modify | |
-- | it under the terms of the GNU General Public License as published by | |
-- | the Free Software Foundation, either version 3 of the License, or | |
-- | (at your option) any later version. | |
-- | | |
-- | AdrianParvin is distributed in the hope that it will be useful, | |
-- | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
-- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |