Skip to content

Instantly share code, notes, and snippets.

@veprbl
veprbl / html5_valid_elements.js
Created August 10, 2011 07:28
TinyMCE valid_elements setting for HTML5
valid_elements : ""
+"@[accesskey|draggable|style|class|hidden|tabindex|contenteditable|id|title|contextmenu|lang|dir<ltr?rtl|spellcheck|"
+"onabort|onerror|onmousewheel|onblur|onfocus|onpause|oncanplay|onformchange|onplay|oncanplaythrough|onforminput|onplaying|onchange|oninput|onprogress|onclick|oninvalid|onratechange|oncontextmenu|onkeydown|onreadystatechange|ondblclick|onkeypress|onscroll|ondrag|onkeyup|onseeked|ondragend|onload|onseeking|ondragenter|onloadeddata|onselect|ondragleave|onloadedmetadata|onshow|ondragover|onloadstart|onstalled|ondragstart|onmousedown|onsubmit|ondrop|onmousemove|onsuspend|ondurationmouseout|ontimeupdate|onemptied|onmouseover|onvolumechange|onended|onmouseup|onwaiting],"
+"a[target<_blank?_self?_top?_parent|ping|media|href|hreflang|type"
+"|rel<alternate?archives?author?bookmark?external?feed?first?help?index?last?license?next?nofollow?noreferrer?prev?search?sidebar?tag?up"
+"],"
+"abbr,"
+"address,"
+"area[alt|coords|shape|href|target<_blank?_self?_top?_parent|ping|media
[Unit]
Description=Gitlab Resque Worker
Requires=redis.service
After=redis.service
Wants=postfix.service mysqld.service
[Service]
Type=forking
User=git
WorkingDirectory=/home/git/gitlab
#!/usr/bin/env python3
"""
Copyright (c) 2010, Dmitry
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
"""
K/A = 0.307075 MeV g^-1 cm^2
-dE/dX = K/A z^2 Z / \beta^2 [0.5*ln(2 m_e \beta^2 \gamma^2 T_{max}/I^2) - \beta^2 - \delta(\beta \gama)/2]
z^2 = 1
Z = 1
p = 850 MeV
M = 139.6 MeV
\gamma = sqrt(1+(p/M)^2) = 6.17
@veprbl
veprbl / gist:9ab33daa07b68c28671c
Created May 16, 2014 17:08
0001-OSX-allow-.-configure-with-only-Command-Line-Tools.patch
From 1b59f4b4edbc66c1afce60dc4c50302259bd8687 Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Tue, 13 May 2014 21:15:29 +0400
Subject: [PATCH] OSX: allow ./configure with only Command Line Tools
As it is now, ROOT can't be built with Cocoa and ./configure without full Xcode
installation. The problem is that Command Line Tools don't provide SDK the way
Xcode does. This patch allows detecting system-wide frameworks available at
/System/... .
---
#!/usr/bin/env python2
from reportlab.pdfgen import canvas
mm = 2.83464567
fms = [(0, 9), (0, 10), (0, 11), (0, 12), (0, 13), (0, 14), (0, 15), (0, 16), (0, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (0, 16), (0, 16), (0, 15), (0, 14), (0, 13), (0, 12), (0, 11), (0, 10), (0, 9)]
ch = 1
row = 0
@veprbl
veprbl / foils-install.sh
Created November 4, 2014 07:21
Foils is a nice alternative to the beamer latex package
#!/bin/sh
cd /tmp
wget http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.dtx
wget http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.ins
latex foiltex.ins
PREFIX=~/Library/texmf
mkdir $PREFIX
mkdir -p $PREFIX/tex/latex/foils
cp foils.sty $PREFIX/tex/latex/foils/
mkdir -p $PREFIX/tex/latex/base
#!/bin/sh
wget http://fastnlo.hepforge.org/code/other/nlojet++-4.1.3-patched.tar.gz
wget http://fastnlo.hepforge.org/code/other/fastjet-3.0.6.tar.gz
wget http://fastnlo.hepforge.org/code/other/qcdnum-17.00.06-patched.tar.gz
wget http://fastnlo.hepforge.org/code/other/lhapdf-5.9.1.tar.gz
wget http://fastnlo.hepforge.org/code/v23/fastnlo_toolkit-2.3.1pre-1871.tar.gz
wget http://fastnlo.hepforge.org/code/v23/fastnlo_interface_nlojet-2.3.1pre-1855.tar.gz
for i in *.tar.gz; do
@veprbl
veprbl / rel_asym_err.py
Created December 18, 2014 02:10
Divide two variables with asymmetric uncertainties
import scipy.optimize
def mlnL_Barlow(x, x_mean, sigma_p, sigma_n):
# from arXiv:physics/0406120
return 0.5 * ((x - x_mean)**2) / (sigma_p * sigma_n + (sigma_p - sigma_n) * (x - x_mean))
assert mlnL_Barlow(7+5, 7, 5, 3) == 0.5
assert mlnL_Barlow(7-3, 7, 5, 3) == 0.5
diff --git a/Makefile.in b/Makefile.in
index 7f18f5c..6d9b237 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -876,10 +876,6 @@ slow:
install-data-local:
mkdir -p $(pkgdatadir)
-@HAS_SVNVERSION_TRUE@ if ! test `svnversion $(srcdir)` = "exported" ; then\
-@HAS_SVNVERSION_TRUE@ svnversion $(srcdir) > $(pkgdatadir)/svnversion ;\