This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in qibuild/actions/build.py | |
""" build stuff """ | |
def configure_parser(parser): | |
qibuild.parser.build_parser(parser) | |
parser.add_argument("target") | |
def do(args): | |
build(args.build_type, arg.target) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in test_qibuild_configure.py | |
def test_qibuild_configure(tmpdir): | |
# do stuff in tmpdir | |
assert rc == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in test_qibuild_configure.py | |
class QiBuildTestCase(unittest.TestCase, ActionTestCase): | |
def setUp(self): | |
self.tmpdir = tmpfile.mkdtemp("test-qibuild-") | |
def test_configure(self): | |
# do stuff in tmpdir | |
rc = ... | |
self.assertEquals(rc, 0) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in qisys.sh | |
def get_config_path(): | |
return get_path(".config") | |
def get_share_path(): | |
return get_path(".local/share") | |
def get_path(): | |
# read XDG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import subprocess | |
import packaging.version | |
import tabulate | |
out = subprocess.check_output(["git", "tag"]).decode("UTF-8") | |
current_branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]) | |
if not current_branch: | |
sys.exit("Not on a branch") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export SOURCE_DATE_EPOCH=$(git log -1 --format=%ct) | |
# This sets SOURCE_DATE_EPOCH to the date of the last commit, (it's even better if it's a | |
# signed tag of course), which is perfect for reproducible builds. | |
# See here for more info : https://reproducible-builds.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.Method; | |
Foo foo = new Foo(); | |
Method method = Foo.class.getDeclaredMethod("private") | |
method.setAccessible(true); | |
method.invoke(foo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" One argument: | |
function! Foo(foo) | |
" Do something with a:foo | |
endfunction | |
command! -nargs=1 -complete=file Foo :call Foo("<args>") " <- note the quotes | |
" Two arguments: | |
function! Foo2(foo, bar) | |
" Do something with a:foo and a:bar | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From the command line: | |
c:\pouet.exe | |
segfault | |
Exit code: 0xc0000005 | |
# From a jenkins slave connected as a Windows service: | |
c:\Users\xxxx\jenkins\workspace\pouet>C:\pouet.exe | |
segfault | |
Exit code: 0xff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" Usage: | |
* Start neovim with NVIM_LISTEN_ADDRESS=/tmp/neovim | |
* Install selenium and neovim Python packages from pypi | |
* Run autorefresh URL | |
* In neovim, map a kep to send the event: | |
nnoremap ,m :w<cr>:call rpcnotify(0, "refresh")<cr> |
OlderNewer