Skip to content

Instantly share code, notes, and snippets.

@felipec
felipec / vte-client.c
Last active March 20, 2023 15:49
Test for vte buggy code
#include <vte/vte.h>
char *cmd = "(for i in $(seq 1 10); do echo $i; sleep 1; done) & exit";
static void run(VteTerminal *terminal)
{
char * const argv[] = { "/bin/bash", "-i", "-c", cmd, NULL };
vte_terminal_spawn_async(terminal,
0, NULL, (char **)argv, NULL, 0, NULL, NULL, NULL, -1, NULL, NULL, NULL);
}
@felipec
felipec / pty-test.c
Last active March 6, 2023 01:25
zsh pty test
#define _XOPEN_SOURCE 600
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/select.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
@felipec
felipec / PKGBUILD
Created February 25, 2023 00:13
vte3-notification
# Maintainer: Jason Edson <jaysonedson _AT_ gmail.com>
# Contributor: Davi da Silva Böger <dsboger _AT_ gmail.com>
# Contributor: Manuel Hüsers <manuel.huesers _AT_ uni-ol.de>
# Contributor: Fernando Fernandez <fernando _AT_ softwareperonista.com.ar>
# Contributor: Jan de Groot <jgc _AT_ archlinux.org>
pkgname=vte3-notification
pkgver=0.70.3
pkgrel=1
pkgdesc='Virtual Terminal Emulator widget (GTK3) (plus Fedora patches)'
#!/bin/bash
d=/tmp/git-test
git init -q -b master "$d"
cd "$d" || exit
for i in $(seq 1000); do
git commit -q -m commit --allow-empty
done
On Tue, Nov 17, 2009 at 2:06 PM, Nanako Shiraishi <nanako3@lavabit.com> wrote:
> Quoting Felipe Contreras <felipe.contreras@gmail.com>
>> Right, your explanation is more clear:
>
> You have a funny way of saying "I'm sorry, I wasn't constructive,
> and my attitude repelled many participants from the discussion".
That's because that's not what I said. If my succinct counter-argument
to a side-topic repelled some people from the much more serious
discussion, that's fine for me, because it means I'm not making myself
@felipec
felipec / git-reviewers
Last active June 19, 2021 21:12
git-reviewers
#!/usr/bin/env ruby
require 'notmuch'
$skip = <<EOF.split("\n")
xmqqsgg7u3js.fsf@gitster.c.googlers.com
CAPig+cRqvd=_n9huD_txEr6EXVrWZx0onReL5bh_mCKy3M3LOg@mail.gmail.com
xmqqy2g08o0r.fsf@gitster.c.googlers.com
20190930153741.GA6124@chatter.i7.local
53844AEF.1080502@alum.mit.edu
@felipec
felipec / git-top-trailers
Last active May 27, 2021 23:42
git-top-trailers
#!/usr/bin/env ruby
ROLES_REGEX = /^([^ \t\n\[\]\(\):]+): ([^<>]+) <(\S+?)>$/
$roles = Hash.new(0)
log_args = [ '--no-merges', '--format=%b%x00' ]
IO.popen(%w[git log] + log_args + ARGV) do |pipe|
pipe.each("\0\n", chomp: true) do |commit|
trailer = commit.scrub.split("\n\n").last
@felipec
felipec / grhg-walk-test
Created June 20, 2019 19:47
Script to test different git-remote-hg revision walking algorithms
#!/usr/bin/env python2
from mercurial import hg, ui, dagop, smartset
import sys, time
class Marks:
def __init__(self):
self.marks = None
@felipec
felipec / scanl.rb
Created January 12, 2018 01:21
Simple scanl implementation
class Array
def scanl(init)
self.reduce([init]) { |a, e| a.push(yield(a.last, e)) }
end
end
accum = [5, 10, 15].scanl(0) { |a, b| a + b }[1..-1]
#!/bin/bash
v=$1
o=$2
d=$4
loaders=('grub')
test -r /etc/default/installkernel &&
source /etc/default/installkernel