Skip to content

Instantly share code, notes, and snippets.

@fabki00
fabki00 / Makefile
Created March 26, 2024 22:34
vscode gdb command line arguments
CC=gcc
CFLAGS=-I. -g -w
LDFLAGS=-lm
OFLAGS = -O0 -g -Wall
DEPS=
OBJ = fbucketsort.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
fbucketsort: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
@fabki00
fabki00 / browser_to_front.java
Created October 11, 2017 19:29
How to bring browser window to front? Use Java Robot class
// get position of browser window and then click on it with a mouse
Robot.mouseMove(webDriver.manage().window().getPosition().getX(),webDriver.manage().window().getPosition().getY());
Robot.mousePress(InputEvent.BUTTON1_MASK);
Robot.mouseRelease(InputEvent.BUTTON1_MASK);
@fabki00
fabki00 / chrome_download.java
Created October 11, 2017 19:17
How to set Chrome preference to prompt for download file?
ChromeOptions chromeOptions = new ChromeOptions();
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("download.prompt_for_download", true);
chromeOptions.setExperimentalOption("prefs", prefs);
WebDriver driver = new ChromeDriver(chromeOptions);
// in mypage.po.ts
export class MyPage {
pageHeaders;
getHeaders() {
return this.pageHeaders.getText(); // returns promise
}
}
// in test.spec.ts
% --------------------------------------------------------------
% This is all preamble stuff that you don't have to worry about.
% Head down to where it says "Start here"
% --------------------------------------------------------------
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}