Skip to content

Instantly share code, notes, and snippets.

@james-jhang
james-jhang / install_SDL2.md
Last active December 8, 2022 05:56
Install SDL2
^(?!Library|Resource)\w.*$
{
"editor.renderWhitespace": "all",
"workbench.colorCustomizations": {
"editorWhitespace.foreground": "#fbff00"
}
}
@james-jhang
james-jhang / borders.css
Last active April 10, 2021 07:18
The CSS for Debugging CSS Layout
As title
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
* * * * * * * { background-color: rgba(255,0,0,.2); }
python -m robot -F robot --NoStatusRC -d ./out -P ./ -P ./"Regression Test" -L TRACE:INFO -v headless:True -v dcTrackURL:"https://%TARGET%" --removekeywords WUKS --listener ./dctlib/listeners/no_rush.py --listener ./dctlib/listeners/performance_logger.py -e exclude-test -e D-NotImplementYet -e "7.0 Backlog" -v shortPeriodOfTime:30s -v normalPeriodOfTime:30s -v longPeriodOfTime:30s .
@james-jhang
james-jhang / Show robotframework report from Jenkins.md
Last active March 20, 2024 04:50
Show RobotFramework report on Jenkins

Show RobotFramework report on Jenkins.

Issue: "Opening Robot Framework log failed"

  • Verify that you have JavaScript enabled in your browser.
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.

Explanation: Due to Content Security Policy (https://content-security-policy.com/).

@james-jhang
james-jhang / ffmpeg_screen_vidoe.md
Last active February 12, 2024 15:03
Record screen by ffmpeg.

Record Chrome screen by ffmpeg.

Commands

The command below can record screen video by ffmpeg on Windows.

ffmpeg -y -rtbufsize 100M -f gdigrab -framerate 30 -probesize 10M -draw_mouse 1 -i title="Task Manager" -c:v libx264 -r 30 -preset ultrafast -tune zerolatency -crf 25 -pix_fmt yuv420p "video output.mp4"
@james-jhang
james-jhang / performanceLogs.py
Created June 1, 2018 06:20
Get all performance logs in chrome driver.
if __name__ == "__main__":
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import json
caps = DesiredCapabilities.CHROME
caps['loggingPrefs'] = {'performance': 'ALL'}
driver = webdriver.Chrome(desired_capabilities=caps)
driver.get('https://stackoverflow.com')
logs = []
for entry in driver.get_log('performance'):