Skip to content

Instantly share code, notes, and snippets.

// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
// Standard Linux bindings disable
{
//===----------------------------------------------------------------------===//
//
// The HashRecognize analysis recognizes unoptimized polynomial hash functions
// with operations over a Galois field of characteristic 2, also called binary
// fields, or GF(2^n): this class of hash functions can be optimized using a
// lookup-table-driven implementation, or with target-specific instructions.
// Examples:
//
// 1. Cyclic redundancy check (CRC), which is a polynomial division in GF(2).
// 2. Rabin fingerprint, a component of the Rabin-Karp algorithm, which is a
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
@artagnon
artagnon / either.hs
Created April 9, 2017 00:02
Either is not a problem in practice
do res <- try (f a)
case res of
Left (ex :: IOException) -> mapMFirst f as
Right res -> return $ Just res
Options +FollowSymLinks -MultiViews
DirectorySlash Off
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME}/ -d
RewriteCond %{SCRIPT_FILENAME}.html !-f
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
from __future__ import print_function
__copyright__ = """
Copyright (C) 2016 The MathWorks, Inc.
Copyright (C) 2011-15 Andreas Kloeckner
"""
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@artagnon
artagnon / smart-vs-dumb-pointer.ll
Created November 12, 2015 20:51
Smart pointer versus dumb pointer (code generation impact)
; ModuleID = 'dumb.cpp'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.10.0"
; Function Attrs: ssp uwtable
define i32 @main() #0 {
entry:
%retval = alloca i32, align 4
%Dumb = alloca i32*, align 8
store i32 0, i32* %retval, align 4
@artagnon
artagnon / git-make.zsh
Last active December 25, 2015 11:58
My custom build script for linux.git.
# usage: git-make ;for x86 linux.git build or make -j 8
# or: git-make prove ;for git.git tests
# or: git-make um ;for um linux.git build
# or: git-make um32 ;for um32 linux.git build
# or: git-make arm ;for arm64 linux.git build
function git-make () {
unset ARCH
unset SUBARCH
unset CROSS_COMPILE
@artagnon
artagnon / new-desktop-build.txt
Created August 9, 2013 11:00
My new desktop
Gigabyte DDR3 1600 LGA 1150 Intel B85 mATX Motherboard GA-B85M-HD3
INR 4,575.11
Kingston Digital 120GB SSDNow V300 SATA 3 2.5 (7mm height) with Adapter Solid State Drive 2.5-Inch SV300S37A/120G
INR 6,411.19
Intel Core i7-4770 Quad-Core Desktop Processor 3.4 GHZ LGA 1150 8 MB Cache BX80646I74770
INR 18,944.56
DVI Gear HDMI Cable 2M 6 feet
@artagnon
artagnon / whatchanged-log.diff
Created August 7, 2013 15:55
The difference between git whatchanged and log
diff --git a/whatchanged b/log
index fa1b223..004d9aa 100644
--- a/tmp/whatchanged
+++ b/tmp/log
@@ -1,4 +1,4 @@
-int cmd_whatchanged(int argc, const char **argv, const char *prefix)
+int cmd_log(int argc, const char **argv, const char *prefix)
{
struct rev_info rev;
struct setup_revision_opt opt;