This file contains 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
# Copyright (c) 2016, James Jackson | |
# All rights reserved. | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# 1. Redistributions of source code must retain the above copyright notice, this | |
# list of conditions and the following disclaimer. | |
# 2. Redistributions in binary form must reproduce the above copyright notice, | |
# this list of conditions and the following disclaimer in the documentation |
This file contains 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
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\7-Zip.001\shell] | |
@="extract" | |
[HKEY_CLASSES_ROOT\7-Zip.001\shell\extract] | |
@="Extract to Folder" | |
[HKEY_CLASSES_ROOT\7-Zip.001\shell\extract\command] | |
@="\"C:\\Program Files\\7-Zip\\7zG.exe\" x \"%1\" -o*" | |
[HKEY_CLASSES_ROOT\7-Zip.7z\shell] |
This file contains 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
#include <Arduino.h> | |
int getChar(FILE *fp) { | |
while (!(Serial.available())) | |
; | |
return (Serial.read()); | |
} | |
int putChar(char c, FILE *fp) { | |
if (c == '\n') { |
This file contains 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
# to execute: "cmake -P ./script.cmake" | |
# ***************************************************************************** | |
if(CMAKE_SCRIPT_MODE_FILE AND NOT CMAKE_PARENT_LIST_FILE) # if it is dirrectly launched in a script mode | |
execute_process( | |
# vvv | |
COMMAND "python" "--version" | |
# ^^^ | |
RESULT_VARIABLE RES # result of the cmd | |
OUTPUT_VARIABLE OUT # output var | |
ERROR_VARIABLE ERR) # error var |
This file contains 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
set -e # exit on error | |
export LANG="C" | |
# Prerequirements: | |
pacman -S --noconfirm --needed autoconf automake colormake git mingw32/mingw-w64-i686-libusb make mingw-w64-i686-gcc mingw-w64-i686-toolchain mingw-w64-i686-libtool mingw-w64-i686-pkg-config mingw-w64-cross-winpthreads-git p7zip | |
# Setup build system | |
export CFLAGS="$CFLAGS -Wno-error" | |
export CPPFLAGS="$CPPFLAGS -D__USE_MINGW_ANSI_STDIO=1 -Wno-error" |
This file contains 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
function _expand ($r_path) { return [IO.Path]::GetFullPath($r_path) } | |
function _path_append ($path) { | |
$p = expand($path) ; $env:Path += ";" + $p | |
Write-Output ('PATH' + " = " + $path + ' + $PATH') | |
} | |
function _path_add ($path) { | |
$p = expand($path); $env:Path += $p + ";" + $env:Path | |
Write-Output ('PATH' + " += " + $path) |
This file contains 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
""" | |
The Script : https://gist.github.com/an-dr/9f3256f4ccd97bc6e04751b542364bff | |
""" | |
class X: | |
""" | |
The Script's Class: https://gist.github.com/an-dr/9f3256f4ccd97bc6e04751b542364bff | |
""" | |
from os.path import realpath, basename, dirname, join |
This file contains 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
# 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) |
This file contains 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
alias a_print_build_vars="printf \" | |
Standart GNU variables for additional building rules: | |
===================================================== | |
ARFLAGS = $ARFLAGS | |
Flags to give the archive-maintaining program; default 'rv'. | |
ASFLAGS = $ASFLAGS | |
Extra flags to give to the assembler (when explicitly invoked on a '.s' or '.S' file). | |
This file contains 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
""" | |
Source: https://www.blog.pythonlibrary.org/2014/02/14/python-101-how-to-change-a-dict-into-a-class/ | |
""" | |
class Dict2Obj(object): | |
""" | |
Turns a dictionary into a class | |
""" | |
NewerOlder