Skip to content

Instantly share code, notes, and snippets.

Akbashev Alexander Jimilian

View GitHub Profile
@Jimilian
Jimilian / test_jenkins_api.py
Last active Jul 23, 2017
Compare performance of basic use cases for two the most popular python libraries for Jenkins
View test_jenkins_api.py
#!/usr/bin/python
from __future__ import absolute_import
import time
import jenkinsapi # python -m pip install jenkinsapi
import jenkins # python -m pip install python-jenkins
jenksins_url= # i.e. "http://myjenkins"
login=
@Jimilian
Jimilian / check_file_exists.py
Created Aug 17, 2016
In some cases exception-way could be much faster
View check_file_exists.py
from __future__ import print_function
import os
import timeit
test1="""
def check_file_classic():
if os.path.exists("asdfas"):
return 1
return 2
View perf_test_serializators.py
from __future__ import print_function
import pickle
try:
import cPickle
test_cPickle = True
except:
test_cPickle = False
import json
import marshal
import timeit
@Jimilian
Jimilian / key_value_pipe_to_json.sh
Last active Jun 10, 2019
Returns json created from pipe
View key_value_pipe_to_json.sh
#!/bin/bash
# Example:
# > echo "key1 value1 key2 value2" | ./key_value_pipe_to_json.sh
# {'key1': value1, 'key2': value2}
arr=();
while read x y;
do
@Jimilian
Jimilian / .vimrc
Last active Dec 30, 2016
Vim settings
View .vimrc
" Standard configuration
filetype plugin indent on
syntax on
set tabstop=4
set shiftwidth=4
set expandtab
" Enables paste mode
set pastetoggle=<F2>
You can’t perform that action at this time.