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
#ifndef HELLOWORLDRULEOFFIVE_H
#define HELLOWORLDRULEOFFIVE_H
class SYMBOL_EXPORT HelloWorldRuleOfFive
{
public:
HelloWorldRuleOfFive() = default;
~HelloWorldRuleOfFive() = default;
HelloWorldRuleOfFive( const HelloWorldRuleOfFive & other ) = default;
HelloWorldRuleOfFive( HelloWorldRuleOfFive && other ) = default;
# retrieve profiles from dedicated repo
git clone git@gitlab.com:<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
#!/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
// 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])
}
@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__)
@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 / 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 / logs_travis.txt
Last active February 17, 2018 22:45
Error Travis CI
2018-02-17 21:54:45.363 xcodebuild[9540:25758] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/var/folders/bb/n7t3rs157850byt_jfdcq9k80000gn/T/com.apple.dt.XCTest/IDETestRunSession-923158DE-39B9-4541-A4B9-96011B65D93B/ApplicationNameTests-A5A0B3DC-9966-4B98-81B0-F2CB230F2ECA/Session-ApplicationNameTests-2018-02-17_215445-vBeZBF.log
2018-02-17 21:54:45.435 xcodebuild[9540:25751] [MT] IDETestOperationsObserverDebug: (A30841CE-7786-4605-AEF3-33E6B81DE16E) Beginning test session ApplicationNameTests-A30841CE-7786-4605-AEF3-33E6B81DE16E at 2018-02-17 21:54:45.434 with Xcode 9B55 on target <DVTiPhoneSimulator: 0x7f9f68192000> {
SimDevice: iPad Air (FFDCEC43-BE2D-46EA-98AA-5643F6882D39, iOS 10.0, Booted)
} (10.0 (14A345))
2018-02-17 21:54:45.456 xcodebuild[9540:26807] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/var/folders/bb/n7t3rs157850byt_jfdcq9k80000gn/T/com.apple.dt.XCTest/IDETestRunSession-923158DE-39B9-4541-A4B9-96011B65D93B/ApplicationNameUITe
@michael-martinez
michael-martinez / gitCheatsheet.txt
Last active March 10, 2021 15:29
gitCheatsheet
To pull before push without merging:
git reset --soft HEAD~ && git stash && git pull && git stash pop
Troubleshoot pbxproj file (Optional):
sed -i '' '/<<<<</d' *.xcodeproj/project.pbxproj
sed -i '' '/=====/d' *.xcodeproj/project.pbxproj
sed -i '' '/>>>>>/d' *.xcodeproj/project.pbxproj
To pick granular setup commits:
git cherry-pick <hash>
@michael-martinez
michael-martinez / AccountKitBaseViewController.swift
Created January 9, 2018 13:22
Facebook Account Kit API Wrapper Class
//
// AccountKitBaseViewController.swift
//
// Created by Michael Martinez on 29/12/2017.
// Copyright © 2017 Michael Martinez. All rights reserved.
//
import Foundation
import AccountKit