Skip to content

Instantly share code, notes, and snippets.

View bjornblissing's full-sized avatar

Björn Blissing bjornblissing

View GitHub Profile
@bjornblissing
bjornblissing / lunch.py
Created March 13, 2024 09:57
Lista dagens luncher i Ebbepark
#!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup, SoupStrainer
import re
# La Luna
def laluna():
print("La Luna")
URL = 'http://www.lalunat1.se'
[gc]
autoDetach = false
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[credential]
helper = manager
[core]
@bjornblissing
bjornblissing / CMakeLists.txt
Last active August 31, 2023 23:18
How to run CppCheck inside Visual Studio as a CMake custom build target.
cmake_minimum_required(VERSION 3.10)
project(MyExampleProject VERSION 1.0 LANGUAGES CXX)
add_executable(my_project main.cpp)
# Add Analyze with CppCheck target if CppCheck is installed
if(WIN32)
# Find CppCheck executable
find_program(CMAKE_CXX_CPPCHECK cppcheck NAMES cppcheck HINTS $ENV{PROGRAMFILES}/cppcheck)
@bjornblissing
bjornblissing / 360deg_animation.pml
Created January 15, 2018 17:28
PyMol script: 360 degree rotation animation in GIF format
# Load PyMol model, file extension will be autodetected
load testmodel
# Start of python script
python
import imageio
# Number of degrees to rotate each frame
step = 10
@bjornblissing
bjornblissing / ignores_initializer.cpp
Created June 3, 2016 14:12
Example of how a constructor of abstract class ignores initializer for virtual base class
#include <iostream>
class Foo {
public:
Foo() : _value(0)
{
std::cout << "Constructor: Foo" << std::endl;
}
explicit Foo(int value) : _value(value)
{
@bjornblissing
bjornblissing / dpiawarescaleing.manifest
Last active June 28, 2019 21:27
Manifest to tell Windows that the application is DPI aware (needed for Windows 8.1 and up)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
</windowsSettings>
</application>
</assembly>
@bjornblissing
bjornblissing / CMakeManifest.txt
Last active February 22, 2022 08:27
CMake script to add manifest to exe-file
# Amend manifest to tell Windows that the application is DPI aware (needed for Windows 8.1 and up)
IF (MSVC)
IF (CMAKE_MAJOR_VERSION LESS 3)
MESSAGE(WARNING "CMake version 3.0 or newer is required use build variable TARGET_FILE")
ELSE()
ADD_CUSTOM_COMMAND(
TARGET ${TARGET_TARGETNAME}
POST_BUILD
COMMAND "mt.exe" -manifest \"${CMAKE_CURRENT_SOURCE_DIR}\\dpiawarescaleing.manifest\" -inputresource:\"$<TARGET_FILE:${TARGET_TARGETNAME}>\"\;\#1 -outputresource:\"$<TARGET_FILE:${TARGET_TARGETNAME}>\"\;\#1
COMMENT "Adding display aware manifest..."