Skip to content

Instantly share code, notes, and snippets.

@8573
8573 / filter.bash
Last active December 30, 2017 02:20 — forked from Aceeri/filter.bash
#!/bin/bash
CON=""
for ARG in "$@"; do
CON+=" | rg '$ARG'"
done
CON="./dlog dwhmanager 2>&1 >/dev/null $CON"
exec bash -c "$CON"
% emulate -R zsh
% setopt | grep -Ei 'autocd|errexit|unset'
% setopt autocd
% setopt | grep -Ei 'autocd|errexit|unset'
autocd
% function f { emulate -L zsh }
% setopt | grep -Ei 'autocd|errexit|unset'
autocd
% f
% setopt | grep -Ei 'autocd|errexit|unset'
zsh $ git <Tab>
Completing alias
cmtmsg -- alias for 'show --no-patch --format=format:%B'
co -- alias for 'checkout'
dry-merge -- alias for '!f() { grep -Fqm 1 'changed in both' <<< $(git merge-tree $(git merge-base $1 $2) $2 $1) && echo 'Merge conflict detected' || echo 'M
edit -- alias for '!$EDITOR'
ffpull -- alias for 'pull --ff-only'
fgca -- alias for '!git gca && git xfsck'
gca -- alias for 'gc --aggressive'
glog -- alias for 'log --graph'
[In the distant past…]
<alkino> ggVGd: do you know you can short your name?
<alkino> ggdG
<ggVGd> yes
<ggVGd> but I have had this discussion before
<ggVGd> there is a philosophical difference
<ggVGd> it is about feedback of destruction
<alkino> uh?
<alkino> can't see difference
@8573
8573 / gist:7781220
Created December 4, 2013 02:21
Example Lua implementation of a “cat” program, for the education of Vultraz.
-- Usage: lua cat.lua file1 file2 file3 ... fileN
-- Writes the concatenation of all the files to the standard output stream.
for _, filename in ipairs(arg) do
local file, err = io.open(filename, 'rb')
if file then
io.write(file:read '*a')
else
error(filename .. ": " .. err)
end
@8573
8573 / gist:5605959
Created May 18, 2013 22:23
Example for Vultraz of a `BOOST_FOREACH` loop over `tod_{red,green,blue}_field_`. May not work; as I said, I’m a bit out of practice with C++.
tfield_integer* tod_colors[] = {tod_red_field_, tod_green_field, tod_blue_field_};
BOOST_FOREACH(tfield_integer* color, tod_colors)
connect_signal_notify_modified(*(color->widget()), boost::bind(
&tcustom_tod::slider_update_callback, this, boost::ref(window)));
@8573
8573 / VirtualBox fail
Created May 4, 2013 01:20
Excerpt from /var/log/kern.log (and /var/log/syslog) from when my Ubuntu system crashed after I tried to start a VirtualBox virtual machine.
May 2 13:40:08 8573 kernel: [197063.992224] general protection fault: 0000 [#1] SMP
May 2 13:40:08 8573 kernel: [197063.992244] CPU 7
May 2 13:40:08 8573 kernel: [197063.992250] Modules linked in: btrfs zlib_deflate libcrc32c ufs qnx4 hfsplus hfs minix ntfs msdos jfs xfs reiserfs ext2 ipt_MASQUERADE iptable_nat bridge stp llc pci_stub vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) parport_pc ppdev bnep rfcomm bluetooth binfmt_misc nls_iso8859_1 dm_crypt joydev arc4 coretemp kvm_intel kvm ip6t_REJECT xt_hl ip6t_rt nf_conntrack_ipv6 nf_defrag_ipv6 ipt_REJECT xt_LOG snd_hda_codec_realtek xt_limit xt_tcpudp xt_addrtype xt_state microcode snd_hda_intel snd_hda_codec snd_hwdep uvcvideo videobuf2_core snd_pcm videodev videobuf2_vmalloc videobuf2_memops thinkpad_acpi snd_seq_midi nvram tpm_tis snd_rawmidi snd_seq_midi_event snd_seq ip6table_filter ip6_tables snd_timer snd_seq_device nf_conntrack_netbios_ns nf_conntrack_broadcast nf_nat_ftp nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 snd nf_conntrack_ftp nf_conntr