This file contains hidden or 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 asyncio | |
loop = asyncio.get_event_loop() | |
async def hello(): | |
await asyncio.sleep(3) | |
print('Hello!') | |
if __name__ == '__main__': | |
loop.run_until_complete(hello()) | |
Example on how to run locally an AWS Lambda via API Gateway using localstack.
Based on...
Only add the xdebug.remote_log
line if you need to troubleshoot.
FROM php:7.1-apache
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
This file contains hidden or 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
#debugging shellscripts -x would show the scrips line by line and output followed by | |
#!/bin/bash -x | |
TEST_VAR="test" | |
echo "$TEST_VAR" | |
#custom | |
#set -x / start debugginh | |
#set +x / stop | |
#-ex exit on stop | |
#-v prints shell before substitution are applied | |
#-vx |
This file contains hidden or 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
package com.jivimberg.sqs.published | |
import kotlinx.coroutines.CancellationException | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.isActive | |
import kotlinx.coroutines.yield | |
import java.lang.Thread.currentThread | |
suspend fun CoroutineScope.repeatUntilCancelled(block: suspend () -> Unit) { | |
while (isActive) { |
There are many ways to test Jenkins...
Jenkins Pipeline Unit is great but it's generally recommended to keep all of your logic with stages and not get too crazy with custom Groovy in your pipeline. Though, it's a great option if you have a very advanced use-case and want to make sure your code is reliable.
The Replay Pipeline Run Option is awesome if you want to verify a quick change or iterate quickly on a previously setup pipeline. But it only allows for altering Jenkinsfile Code and runs against the production Jenkins Instance.
This file contains hidden or 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
tap 'homebrew/cask' | |
tap 'homebrew/cask-drivers' | |
tap 'homebrew/cask-fonts' | |
tap 'homebrew/cask-versions' | |
tap 'homebrew/core' | |
tap 'homebrew/boneyard' | |
tap 'homebrew/dev-tools' | |
tap 'homebrew/bundle' | |
tap 'homebrew/services' |
This file contains hidden or 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
# see rkengler.com for related blog post | |
# https://www.rkengler.com/how-to-capture-network-traffic-when-scraping-with-selenium-and-python/ | |
import json | |
import pprint | |
from selenium import webdriver | |
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | |
capabilities = DesiredCapabilities.CHROME |