My personal notebook for day-to-day vim usage.
i / [Insert]
enters insert mode at current characterI
enters insert mode at beginning of linea
enters insert mode at next characterA
enters insert mode at end of line$
goto end of line
# Example: curl http://localhost:8000 --data '{"nested": {"flowID": "world"}, "data": "hello"}' | |
sources: | |
in: | |
type: http_server | |
address: 0.0.0.0:8000 | |
codec: json | |
transforms: | |
remap: |
#!/bin/bash | |
# cat input.txt | ./solve1.sh | |
grep -Po 'mul\(\d+,\d+\)' | | |
sed -r 's/^mul\(([0-9]+),([0-9]+)\)$/\1*\2/' | | |
xargs | | |
sed -e 's/\ /+/g' | | |
xargs -I @@ bash -c 'echo $((@@))' |
#!/bin/bash | |
# cat input.txt | ./solve1.sh | |
while read -r rpt; do | |
echo "$rpt" | | |
sed 's/\s\+/\n/g' | | |
sort -n | | |
xargs | | |
while read -r srt; do | |
echo "$rpt" | |
#!/bin/bash | |
dbg="+x" | |
set "$dbg" | |
in="$1" | |
awk '{print $1}' "$in" |\ | |
sort |\ | |
nl -bt -nln |\ | |
xargs -I '{}' bash $dbg -c "\\ |
# Original __git_ps1 | |
$ time orig__git_ps1 || 0 | |
(my-branch) | |
real 0m1.102s | |
user 0m0.000s | |
sys 0m0.140s | |
# Lean function | |
$ time __git_ps1 || 0 | |
(my-branch) |
/// Some sorting algorithms written in Rust. | |
fn insertion_sort(vec: &mut Vec<i32>) { | |
let length: i32 = vec.len() as i32; | |
if length < 2 { | |
// Vector is already sorted if of length 0 or 1 | |
return; | |
} |
package tictactoegame.ui; | |
import javax.swing.*; | |
import java.awt.*; | |
public class SwingTicTacToe extends JFrame { | |
/** | |
* The font used for the buttons. | |
*/ |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <limits.h> | |
#include <sys/mount.h> | |
extern char * ffmount(char *path) | |
{ | |
int rc; |