Skip to content

Instantly share code, notes, and snippets.

View vanclist's full-sized avatar

Viacheslav Artemchuk vanclist

View GitHub Profile
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 10, 2024 06:00
set -e, -u, -o, -x pipefail explanation
# Our architecture didn't allow us
# to customize message body in a right way.
# That is why we fuck it up right here.
def fuck_short_url(text)
return nil unless text
# Offer short url in email should differ from generic one
# Additional parameters should be included:
# share_specific_short_url includes {source: 'email', email_shared_with: email}
# Sometimes we can not avoid this hack because of the following usecase:
# When user is sharing offer via email though talkable offer page
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active May 9, 2024 20:15
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@unfulvio
unfulvio / vagrant_setdate.sh
Last active June 30, 2022 16:33
How to change server time on a Vagrant box on Virtualbox
#!/bin/bash
# Log in into the box
vagrant ssh
# VirtualBox syncs host time with guest, so we need to shut off VBox Guest Additions first
sudo service vboxadd-service stop
# Now you can set any date and time
sudo date -s "2020-10-01 10:25:00"
@unstabler
unstabler / encode-all.sh
Last active March 24, 2017 09:25
ffserver streaming
#!/bin/sh
for file in *.avi
do
file_without_ext=$(echo "$file" | sed -e 's/\.avi//')
subtitle="$file_without_ext.smi"
outfile="$file_without_ext.ts"
if ! [ -f "$subtitle" ]
then
echo "자막 파일 $subtitle 이 존재하지 않습니다! 다음으로 넘어갑니다.." | tee -a encode.log
continue

You need:

Define module constuructor in init.py

import os
from selenium_utils.page import PageBuilder

from selenium_utils import read_utils_config
from selenium_utils.screenshot import WebScreenShotUtil
from selenium_utils.splinter_wrapper import SplinterDriver, SplinterFactory
@groovybayo
groovybayo / step-by-step-gatling-idea.md
Last active November 7, 2022 06:47
Gatling: Step by step guide to IntelliJ integration

Step by step guide to setting up IDEA to write gatling simulations

Prerequisites:

Have [SBT plugin][sbt-plugin] installed

Begin

  • [Create a new project][create-project] in IDEA ( File > New Project ...)
    • Make sure you select a maven module
@jboner
jboner / latency.txt
Last active May 10, 2024 14:27
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD