Skip to content

Instantly share code, notes, and snippets.

View nega0's full-sized avatar
🌴
I may be slow to respond.

nega nega0

🌴
I may be slow to respond.
View GitHub Profile
--- /dev/null 2010-03-17 10:23:05.304266802 -0400
+++ main.c 2010-03-18 15:26:14.000000000 -0400
@@ -0,0 +1 @@
+void MAIN__() {}
--- /dev/null 2011-01-28 15:18:26.820752001 +0100
+++ pythia6_rng_callback.c 2011-02-03 21:35:13.542831166 +0100
@@ -0,0 +1,24 @@
+/* forward decl, original Pythia impl */
+extern double old_pyr_(int* idummy);
+
+/* function pointer contating the current impl */
+double (*pyr_callback)(int*) = 0;
+
+/* setter for the pyr callback */
--- pythia6416.f.orig 2008-03-14 09:37:15.000000000 +0100
+++ pythia6416.f 2011-02-03 20:03:16.622831025 +0100
@@ -70354,8 +70354,24 @@
C...PYR
C...Generates random numbers uniformly distributed between
C...0 and 1, excluding the endpoints.
+C...Calls back to an externally defined function EXT_PYR
FUNCTION PYR(IDUMMY)
+ DOUBLE PRECISION PYR, EXT_PYR
--- /dev/null 2015-09-14 09:02:32.937677367 -0400
+++ Makefile 2015-09-18 12:14:24.000000000 -0400
@@ -0,0 +1,36 @@
+CC=gcc
+CFLAGS=$(FFLAGS)
+OSNAME=$(shell uname -s)
+
+all: lib-shared
+
+tpythia6_called_from_cc.o:
## This macro takes 2 arguments. The first, _d, is an "integer date"
## in the format of "YYYYmmdd". The second, _m, is a message that will
## be passed to message(WARNING ...) or message(FATAL_ERROR ...). A
## one line message is recomended.
##
## It is recomended that you provide some explanitory warning prior to
## calling this macro.
## An example follows ...
@nega0
nega0 / iptables_color_with_grc.txt
Last active June 29, 2017 18:11
colorize `iptables` with grc
## based on https://gist.github.com/nega0/1d232622a1fa3dad176869bbfe747602
## conf file for https://github.com/garabik/grc
## put in ~/.grc/conf.iptables
# chain section headers
regexp=^Chain.*
colors=underline
=======
# column headers
regexp=^num.*
@nega0
nega0 / init.el
Created February 24, 2019 15:27
minimal init.el w/ package.el initialization and tramp
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)
;; Bootstrap 'use-package'
(eval-after-load 'gnutls
@nega0
nega0 / wipe.bat
Created June 8, 2019 21:20
wipe partition table with debug.exe
debug <wipe.in
@nega0
nega0 / opt.pl
Created July 24, 2019 14:22
create an optimized regular expression (regex/regexp) from list of strings
#!/usr/bin/perl -w
use feature qw(say);
use strict;
use Regexp::List;
my @s = <STDIN>;
my $l = Regexp::List->new;
say $l->list2re(@s);
@nega0
nega0 / svnhacks.sh
Last active November 11, 2019 21:28 — forked from scrooloose/svnhacks.sh
This script hijacks calls to svn and adds color and pagination to some svn commands. Source it from your ~/.zshrc.
#Author: Martin Grenfell [http://github.com/scrooloose]
#License:
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
#
#This script hijacks calls to svn and adds color and pagination to