Skip to content

Instantly share code, notes, and snippets.

View michael-martinez's full-sized avatar
🎯
Focusing

Michaël Martinez michael-martinez

🎯
Focusing
View GitHub Profile
@michael-martinez
michael-martinez / xcode_podspec.sh
Last active February 22, 2018 12:39
Automatically creates podspec file, tag V1.0.0 and push to your repository.
#!/bin/sh
# To run :
# $ chmod +x xcode_podspec.sh
# $ /bin/sh xcode_podspec.sh /path/to/project/
echo "========== Pod Spec Start =========="
# define paths
projectPath="$1"
basename=$(basename $projectPath)
@michael-martinez
michael-martinez / setupAdbOverWifi.sh
Last active July 21, 2020 12:54
Configures Android adb to work over Wifi
#!/bin/bash
echo 'Please ensure that you enabled Developer Mode on Android device.'
read -p "Press any key to confirm..."
echo 'Please ensure that you enabled Usb Debugging on Android device.'
read -p "Press any key to confirm..."
echo 'Please ensure that your device is connected to computer through USB.'
read -p "Press any key to confirm..."
IP_ADDRESS=$1
@michael-martinez
michael-martinez / type_inspector.h
Created December 14, 2020 10:01
C++ Type Inspector for C++17
#include <string_view>
template <typename T>
constexpr auto type_name() noexcept {
std::string_view name = "Error: unsupported compiler", prefix, suffix;
#ifdef __clang__
name = __PRETTY_FUNCTION__;
prefix = "auto type_name() [T = ";
suffix = "]";
#elif defined(__GNUC__)
// MARK: Reading Values
private var receiveDetectionEventsTimer: Timer? = nil
func receiveDetectionEvents() {
let charUuid = wifiUuid
print("STEP 1: READING CHARACTERISTIC \(charUuid)...")
if manager == nil {
manager = CentralManager(options: [CBCentralManagerOptionRestoreIdentifierKey : "CentralMangerKey" as NSString])
}
#!/bin/sh
wget https://cmake.org/files/v3.20/cmake-3.20.4.tar.gz
tar zxvf cmake-3.*
cd cmake-3.*
./bootstrap --prefix=/usr/local -- -DCMAKE_USE_OPENSSL=OFF
make -j $( ([[ $OSTYPE == 'darwin'* ]] && sysctl -n hw.ncpu ) || ( cat /proc/cpuinfo |grep processor | wc -l ) )
make install
# retrieve profiles from dedicated repo
git clone [email protected]:<some_repo>/conan-config.git
cd conan-config/
# install profiles on ~/.conan/profiles/
conan config install .
# add repo credentials
conan user -p <password> -r <repo_name> <username>
conan install libusb/1.00.0@<repo_name>/stable -b outdated
#ifndef HELLOWORLDRULEOFFIVE_H
#define HELLOWORLDRULEOFFIVE_H
class SYMBOL_EXPORT HelloWorldRuleOfFive
{
public:
HelloWorldRuleOfFive() = default;
~HelloWorldRuleOfFive() = default;
HelloWorldRuleOfFive( const HelloWorldRuleOfFive & other ) = default;
HelloWorldRuleOfFive( HelloWorldRuleOfFive && other ) = default;