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
diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c | |
index 2612d6a..277afb0 100644 | |
--- a/libc/dns/net/getaddrinfo.c | |
+++ b/libc/dns/net/getaddrinfo.c | |
@@ -80,6 +80,7 @@ | |
#include <fcntl.h> | |
#include <sys/cdefs.h> | |
#include <sys/types.h> | |
+#include <time.h> | |
#include <sys/stat.h> |
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 is a small test environment for autorandr, that can be added as a | |
pre-commit git hook in local copies of the repository. | |
How-to: | |
Run `generate_fixtures.sh` to build all xrandr versions and generate fixtures. | |
Fixtures are a set of two files, FOO.version and FOO.verbose, that are the output | |
of `xrandr -v` and `xrandr --verbose -q`. You can also write more elaborate | |
tests by placing a script into the dynamic/ subfolder. It will be executed instead | |
of xrandr by tests. |
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
#!/bin/sh | |
git clone http://cgit.freedesktop.org/xorg/app/xrandr/ || exit 1 | |
cd xrandr || exit 1 | |
for TAG in $(git tag | grep "^xrandr-"); do | |
git reset --hard HEAD | |
git clean -fx | |
git checkout $TAG | |
mv configure.ac configure.ac~ | |
grep -vE "(m4_ifndef|m4_fatal|XORG_MACROS_VERSION)" configure.ac~ > configure.ac |
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
#!/usr/bin/env python | |
""" | |
A quick & dirty replacement for dpkg-shlibdeps | |
Written to check if pqiv uses any unnecessary depencencies. dpkg-shlibdeps | |
claims that this was the case and I wanted to check. | |
""" | |
import functools | |
import multiprocessing.pool | |
import os |
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
function magic!(M::Array{Int}, n::Int) | |
# Fast magic square generation | |
# | |
# | |
if n % 2 == 1 | |
# Odd-order magic square | |
# Algorithm: http://en.wikipedia.org/wiki/Magic_square#Method_for_constructing_a_magic_square_of_odd_order | |
# | |
ndiv2 = div(n, 2); | |
for I = 1: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
# These are possibly naïve implementations of magic squares generation | |
# for a micro-benchmark to compare Julia to Python and Matlab | |
# | |
function magic_matlab(n::Int64) | |
# Works exactly as Matlab's magic.m | |
if n % 2 == 1 | |
p = (1:n) | |
M = n * mod(broadcast(+, p', p - div(n+3, 2)), n) + mod(broadcast(+, p', 2p - 2), n) + 1 |
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
#!/usr/bin/env python | |
from distutils.core import setup | |
from Cython.Build import cythonize | |
setup( | |
ext_modules = cythonize("test.pyx") | |
) |
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
#!/bin/bash | |
# | |
# Build a statically linked version of all pqiv prerequisites and some fake | |
# ones (atk-bridge, epoxy). Then, compile a statically linked version of pqiv. | |
# | |
# This script is only useful in Linux. For Windows, use mxe.cc, a great script | |
# to compile mingw cross compiler environments with all the required | |
# dependencies and libraries. | |
# | |
# The resulting binary works fine at least between libc 2.15 and 2.19 despite |
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
WHAT THIS IS | |
------------ | |
The DELL LATITUDE E7440's docking station supports two external displays, and | |
the notebook's Haswell architecture supports having three displays active at | |
the same time. It works well, but the two external monitors are merged into one | |
big display: | |
$ xrandr | |
Screen 0: minimum 320 x 200, current 5280 x 1080, maximum 32767 x 32767 | |
eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 174mm |
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
AddHandler cgi-script .cgi | |
<Files "git.cgi"> | |
Require valid-user | |
AuthType Basic | |
AuthName "GIT Access" | |
AuthUserFile /path/to/.htpasswd.git | |
</Files> |