Skip to content

Instantly share code, notes, and snippets.

View artagnon's full-sized avatar

Ramkumar Ramachandra artagnon

View GitHub Profile
# 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;
@artagnon
artagnon / chennai-travel.txt
Created August 1, 2013 09:38
What to do in Chennai
I'll exclude what you can find easily on Wikitravel:
- The city organizes carnatic music concerts every now and then called
"kutcheris". Ask a friend interested in music to take you to one.
- It's less cosmopolitan than consumerist than many other cities
(eg. Bangalore); very few avenues for spending. Avoid the big chains
(Cafe Coffee Day, Kentucky Fried Chicken, Dominos Pizza etc): you'll
have plenty of time to check them out in other Indian cities. The
big weekend activity for a family is going out for dinner: so, check
@artagnon
artagnon / Makefile
Last active December 20, 2015 08:49
textadept Makefile
# Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
kernel = $(shell uname -s)
ifneq (, $(or $(findstring Linux, $(kernel)), $(findstring BSD, $(kernel))))
ifeq (win, $(findstring win, $(MAKECMDGOALS)))
# Cross-compile for Win32.
ifeq (win32, $(findstring win32, $(MAKECMDGOALS)))
arch = win32
CROSS = i686-w64-mingw32-
lua_dll = luajit/src/lua51.dll