Skip to content

Instantly share code, notes, and snippets.

View aperezdc's full-sized avatar
🛋️
Couch-potatoing

Adrian Perez aperezdc

🛋️
Couch-potatoing
View GitHub Profile
@aperezdc
aperezdc / PKGBUILD-j4status-git.sh
Last active February 10, 2019 17:32
Updated PKGBUILD for the j4status-git package
# Maintainer: Moritz Maxeiner <moritz@ucworks.org>
pkgname=j4status-git
pkgver=445.8c017e4
pkgrel=1
pkgdesc="A plugin-based status line generator: j4status generates a status line to use with bar programs (like i3bar). It is plugin-based to allow anyone to extend it easily."
arch=('i686' 'x86_64')
url='https://sardemff7.github.io/j4status/'
license=('GPL')
provides=('j4status')
@aperezdc
aperezdc / PKGBUILD-hotdoc.sh
Created January 7, 2019 13:57
Updated PKGBUILD for HotDoc 0.8.103
# Copyright 2018 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@aperezdc
aperezdc / unwindtest.c
Created October 17, 2017 15:18
Example on how to dump stack trace on SIGUSR2, useful if program gets stuck
/*
* unwindtest.c
* Copyright (C) 2017 Adrian Perez <aperez@igalia.com>
*
* Distributed under terms of the MIT license.
*/
#define _GNU_SOURCE
#include <ucontext.h>
#include <dlfcn.h>
@aperezdc
aperezdc / .autoenv.zsh
Created August 24, 2017 12:07
Autoenv snippet for WebKit source trees
#
# Place this in the root directory of a WebKit source tree.
#
# This needs the following Zsh plug-ins:
#
# https://github.com/Tarrasch/zsh-autoenv
# https://github.com/aperezdc/virtualz
#
autostash WEBKIT_TOP_LEVEL="${0:A:h}"
@aperezdc
aperezdc / PKGBUILD.tartan-git.sh
Created August 22, 2017 18:36
Arch Linux PKGBUILD for Tartan
# Maintainer: TingPing <tingping@tingping.se>
pkgname='tartan-git'
pkgver=0.3.0.r14.g5d9a499
pkgrel=1
pkgdesc='Clang analysis plugin for GLib and GNOME'
url='https://www.freedesktop.org/software/tartan/'
arch=('i686' 'x86_64')
provides=('tartan')
conflicts=('tartan')
license=('GPL3')
@aperezdc
aperezdc / jhenv.sh
Created March 3, 2017 13:02
Run a shell (or a command) using an alternate prefix, inspired by JHBuild
#! /bin/bash
# vim: set ts=4 sw=4 noet
#
# jhenv
# Copyright (C) 2017 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
#
set -e
@aperezdc
aperezdc / buildroot-config-wpe
Last active July 29, 2019 19:51
Buildroot configuration to build WPE with WebRTC enabled
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2017.02-rc1-12213-gb8bb78c99 Configuration
#
BR2_HAVE_DOT_CONFIG=y
BR2_HOST_GCC_AT_LEAST_4_5=y
BR2_HOST_GCC_AT_LEAST_4_6=y
BR2_HOST_GCC_AT_LEAST_4_7=y
BR2_HOST_GCC_AT_LEAST_4_8=y
BR2_HOST_GCC_AT_LEAST_4_9=y
@aperezdc
aperezdc / .autoenv.zsh
Created November 2, 2016 17:22
Autoenv scripts to prepare an Android build environment in a directory
# Needs "curl", "sha1sum", some basic shell tools,
# plus the following Zsh plugins installed:
#
# https://github.com/Tarrasch/zsh-autoenv
# https://github.com/aperezdc/virtualz
#
# Drop this file into a new directory as .autoenv.zsh
# and enter it to have a virtualenv configured to use
# for building Android, and the "repo" tool installed
# and ready to be used. Bonus: ccache is configured.

Keybase proof

I hereby claim:

  • I am aperezdc on github.
  • I am aperezdc (https://keybase.io/aperezdc) on keybase.
  • I have a public key ASBkif_OHqrzpx3d7P1K378eO_uN2reqFz2jRmGL3LKgZAo

To claim this, I am signing this object:

@aperezdc
aperezdc / switch-labels-goto.c
Created September 4, 2015 11:13
Jump to label inside a switch statement in C
/*
* Silly example demonstrating that it is valid to jump
* to arbitrary labels inside "switch" statements using
* "goto" in C.
*/
bool is_not_small_power_of_two (int value)
{
if (value < 0) {
/* It is legal to jump into a switch */