Skip to content

Instantly share code, notes, and snippets.

Avatar

Pavol Juhas pavoljuhas

View GitHub Profile
View sascalculator.py
#!/usr/bin/env python
##############################################################################
#
# diffpy.srreal by DANSE Diffraction group
# Simon J. L. Billinge
# (c) 2010 The Trustees of Columbia University
# in the City of New York. All rights reserved.
#
# File coded by: Pavol Juhas
#
@pavoljuhas
pavoljuhas / estimatepdfguiesds.py
Created Nov 1, 2017
fix estimate of standard deviations reported from PDFgui project
View estimatepdfguiesds.py
#!/usr/bin/env python
import sys
import numpy
def getfitesd(fit):
import cStringIO
from diffpy.pdffit2 import redirect_stdout
# throw away any output from pdffit2
redirect_stdout(cStringIO.StringIO())
@pavoljuhas
pavoljuhas / screenshot.png
Last active Sep 7, 2017
example of wx.TextCtrl with a hyperlink
@pavoljuhas
pavoljuhas / sconscript.local
Last active Apr 5, 2016
sconscript.local for diffpy.srreal
View sconscript.local
# vim: ft=python
import sys
import os.path
Import('env')
env.CacheDir('/tmp/my-scons-cache')
includedir = sys.prefix + '/include'
libdir = sys.prefix + '/lib'
@pavoljuhas
pavoljuhas / NaCl.cif
Last active Dec 4, 2015
Calculate PDF from a 2D slab with analytic baseline
View NaCl.cif
#------------------------------------------------------------------------------
#$Date: 2010-01-30 13:59:17 +0000 (Sat, 30 Jan 2010) $
#$Revision: 966 $
#$URL: svn://cod.ibt.lt/cod/cif/1/1000041.cif $
#------------------------------------------------------------------------------
#
# This file is available in the Crystallography Open Database (COD),
# http://www.crystallography.net/
#
# All data on this site have been placed in the public domain by the
@pavoljuhas
pavoljuhas / ctagswatch
Last active Aug 29, 2015
watch source files and re-run ctags whenever they change.
View ctagswatch
#!/bin/zsh -f
########################################################################
# setup:
setopt extendedglob
: ${WATCHPERIOD:=10}
: ${IDLETIMEOUT:=5400}
ignored=( '*?.o' '*?.obj' '*?.old' '*?.pro' '*?.*~' '*.bak' '*.pyc'
'*/#CVS/*' '*/#AAPDIR/*' )
ipat="(${(j:|:)ignored})"
@pavoljuhas
pavoljuhas / pypath
Last active Feb 6, 2018
pywhichmodule, pypath -- find out what Python imports and where does it look
View pypath
#!/usr/bin/env python
import sys
import os
mydir = os.path.realpath(os.path.dirname(sys.argv[0]))
notmydir = lambda d : not (os.path.exists(d) and
os.path.realpath(d) == mydir)
p = filter(notmydir, sys.path)
print('\n'.join(p))
@pavoljuhas
pavoljuhas / rst.vim
Created Dec 10, 2013
Vim filetype plugin for restructured-text (rst) files. This file should be dropped to ~/.vim/ftplugin/ directory.
View rst.vim
setlocal suffixesadd+=.rst
setlocal shiftwidth=3 shiftround
setlocal expandtab
setlocal textwidth=72
You can’t perform that action at this time.