Skip to content

Instantly share code, notes, and snippets.

@caiogallo
caiogallo / gist:aa307882f149b347c7361ca26df6817c
Created April 30, 2018 14:43
Pipeline do jenkins para deploy com docker
node{
stage('git pull') {
git url: 'https://github.com/caiogallo/ci-sample.git', branch: 'master'
}
stage('build'){
withMaven(maven: 'maven'){
sh 'mvn clean package'
}
}
stage('Build docker images'){
@nddipiazza
nddipiazza / disable-cookie-validation.patch
Created March 8, 2018 15:38
Changes to apply to firefox in order to allow web driver to add cookies before navigating to a page (Universal diff format)
@merikan
merikan / Jenkinsfile
Last active April 16, 2025 07:30
Some Jenkinsfile examples
Some Jenkinsfile examples
GIST_PROFILE_PATH=~/.bash_profile_gist
GIST_PROFILE_URI=https://gist.githubusercontent.com/aenniw/7f1883a867e5d551b9c859eba176b6b3/raw/.bash_profile_gist
function update-gist() {
curl -s ${GIST_PROFILE_URI} 2>/dev/null > ${GIST_PROFILE_PATH}
}
function resource-gist() {
test -f ${GIST_PROFILE_PATH} && \
source ${GIST_PROFILE_PATH}
@molotovbliss
molotovbliss / mysql-large-db-import
Created November 29, 2016 18:05
Importing Large DB faster MySQL Settings
Source: https://dba.stackexchange.com/questions/83125/mysql-any-way-to-import-a-huge-32-gb-sql-dump-faster
innodb_buffer_pool_size = 4G
innodb_log_buffer_size = 256M
innodb_log_file_size = 1G
innodb_write_io_threads = 16
innodb_flush_log_at_trx_commit = 0
Why these settings ?
innodb_buffer_pool_size will cache frequently read data
FROM tomcat:8.0.38
# Place the code version inside the webapps directory
ARG PACKAGE_VERSION
RUN echo "${PACKAGE_VERSION}" >> /usr/local/tomcat/webapps/version.txt
COPY project.war /usr/local/tomcat/webapps/project.war
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
@tzmartin
tzmartin / embedded-file-viewer.md
Last active April 16, 2025 14:36
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

stage 'Test'
// Split the previously executed tests into 10 jobs
def splits = splitTests parallelism: [$class: 'CountDrivenParallelism', size: 10], generateInclusions: true
def branches = [:]
// Prepare each job
for (int i = 0; i < splits.size(); i++) {
def split = splits[i]
branches["split${i}"] = {
// The job should allocate a new jenkins slave
node('dockerSlave') {
class A
def initialize
p :A
end
end
class B < A
def initialize
p :B
end
@jhass
jhass / .rubocop.yml
Last active January 7, 2025 19:23
My preferred Rubocop config
AllCops:
RunRailsCops: true
# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength: