Skip to content

Instantly share code, notes, and snippets.

View yv84's full-sized avatar
๐Ÿ’
Focusing

Vladimir Yudintsev yv84

๐Ÿ’
Focusing
View GitHub Profile
@yv84
yv84 / jenkins-pipeline-git-cred.md
Created April 12, 2019 12:41 — forked from blaisep/jenkins-pipeline-git-cred.md
Insert git credentials into Jenkins Pipeline Script projects

Suppose you want to inject a credential into a Pipeline script. The cloudbees note does not include Pipeline script examples. https://support.cloudbees.com/hc/en-us/articles/203802500-Injecting-Secrets-into-Jenkins-Build-Jobs

The Jenkins Pipeline Docs' description of the git pushmethod doesn't have an example using injected credentials. (https://jenkins.io/doc/pipeline/examples/#push-git-repo)

The Snippet generator is helpful, but not not if you try to follow the instructions at: https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Binding+Plugin

@yv84
yv84 / Dockerfile
Last active January 18, 2019 05:40 — forked from anonymous/Dockerfile
# https://medium.com/@shakyShane/lets-talk-about-docker-artifacts-27454560384f
# Stage 1 - the build process
FROM node:7.10 as build-deps
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn
COPY . ./
RUN yarn build
# Stage 2 - the production environment
@yv84
yv84 / python_java_time.py
Created December 29, 2017 03:17 — forked from huskercane/python_java_time.py
Convert from java timestamp to python datetime and vice versa
def _convert_java_millis(java_time_millis):
"""Provided a java timestamp convert it into python date time object"""
ds = datetime.datetime.fromtimestamp(
int(str(java_time_millis)[:10])) if java_time_millis else None
ds = ds.replace(hour=ds.hour,minute=ds.minute,second=ds.second,microsecond=int(str(java_time_millis)[10:]) * 1000)
return ds
def _convert_datetime_java_millis(st):
"""Provided a python datetime object convert it into java millis"""
package ru.serce.gctest;
import java.lang.reflect.Method;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
public class GcPermgenTest {
@yv84
yv84 / replacer.py
Last active February 19, 2018 10:02 — forked from meddulla/replacer.py
Script to recursively replace string in filename and contents
"""
Usage: python script.py search_string replace_string dir
Eg. python batchreplace.py galleries productions /Sites/cjc/application/modules/productions/
And it will search recursively in dir
and replace search_string in contents
and in filenames.
Case-sensitive
"""
from sys import argv
@yv84
yv84 / app.py
Last active August 29, 2015 14:05 — forked from tistaharahap/app.py
assets = Environment(app)
assets.url = '/static'
assets.directory = app.config['ASSETS_DEST']
coffee = Bundle(
'coffee/models.coffee',
'coffee/app.coffee',
filters='coffeescript',
output='js/app.js'
)
@yv84
yv84 / test_asyncio_mosk.py
Last active August 29, 2015 14:01 — forked from trecouvr/Mockin' asyncio coroutine
Mockin' asyncio coroutine
import asyncio
import unittest
import unittest.mock
class MyClass:
@asyncio.coroutine
def coro1(self):
g = yield from self.coro2()