Skip to content

Instantly share code, notes, and snippets.

View ButchDean's full-sized avatar
💻
Well, it works on my docker container! ¯\_(ツ)_/¯

Dean Butcher ButchDean

💻
Well, it works on my docker container! ¯\_(ツ)_/¯
View GitHub Profile
@MHBalsmeier
MHBalsmeier / eccodes_on_ubuntu.md
Last active October 9, 2024 20:07
How to install Eccodes on Ubuntu

How to Install Eccodes on Ubuntu

Eccodes is an open source library made by ECMWF for reading and writing grib files, which is the most common file format for meteorological und oceanographic data in operational use (while in research, Netcdf is mainly used). If one wants to work with grib files seriously, one will have to install it earlier or later. On top of that, one will also have to make sure C and Python code is able to import the library's functionality.

First of all, I would highly recommend not to use anything else than Linux, preferably Ubuntu, for working with meteorological data, especially grib files. If you do not want to migrate to Linux completely, consider either a dual boot or a virtual machine.

I just show you the commands with minimal explanation.

Installing an older version with apt

@fnky
fnky / ANSI.md
Last active November 29, 2024 03:03
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@baiwfg2
baiwfg2 / CMakeLists.txt
Created September 29, 2018 12:42
How to use add_custom_target and add_custom_command correctly in cmake
# References:
# https://cmake.org/cmake/help/latest/command/add_custom_target.html
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
# https://gist.github.com/socantre/7ee63133a0a3a08f3990
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777
cmake_minimum_required(VERSION 3.10)
@mbinna
mbinna / effective_modern_cmake.md
Last active November 28, 2024 22:01
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@gravitylow
gravitylow / codesign_gdb.md
Last active October 23, 2024 09:17 — forked from hlissner/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
@evertrol
evertrol / Makefiles.md
Last active November 15, 2024 12:05
Makefile cheat sheet

Makefile cheat sheet

Mostly geared towards GNU make

I've used ->| to indicate a tab character, as it's clearer to read than

  • Set a target, its dependencies and the commands to execute in order
target: [dependencies]
->| 
@gyakoo
gyakoo / uwp_changeToFullscreen.cpp
Last active April 2, 2018 00:47
UWP C++ Fullscreen snippet
// Made this code to change to fullscreen, useful if you're creating a DX application in vs2015/c++/uwp
// Also look at this sample: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/FullScreenMode/cpp
// And this MSDN page: https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.viewmanagement.applicationview.preferredlaunchwindowingmode?cs-save-lang=1&cs-lang=cpp#code-snippet-1
// preferred mode in constructor
App::App()
{
// starts with this window size
Windows::UI::ViewManagement::ApplicationView::PreferredLaunchViewSize= Windows::Foundation::Size(800,600);
Windows::UI::ViewManagement::ApplicationView::PreferredLaunchWindowingMode = Windows::UI::ViewManagement::ApplicationViewWindowingMode::PreferredLaunchViewSize;
}
@hlissner
hlissner / codesign_gdb.md
Last active September 29, 2024 00:25
Codesign gdb on OSX
@mawenbao
mawenbao / Makefile
Created February 26, 2014 05:16
googletest simple example
# Makefile for gtest examples
GOOGLE_TEST_LIB = gtest
GOOGLE_TEST_INCLUDE = /usr/local/include
G++ = g++
G++_FLAGS = -c -Wall -I $(GOOGLE_TEST_INCLUDE)
LD_FLAGS = -L /usr/local/lib -l $(GOOGLE_TEST_LIB) -l pthread
OBJECTS = main.o string-compare.o