Skip to content

Instantly share code, notes, and snippets.

Avatar

Vincent Tourraine vtourraine

View GitHub Profile
View AppDelegate+Menus.swift
// MARK: - Menus
override func buildMenu(with builder: UIMenuBuilder) {
super.buildMenu(with: builder)
builder.insertChild(AppDelegate.fileMenu(), atStartOfMenu: .file)
builder.insertChild(AppDelegate.viewMenu(), atStartOfMenu: .view)
builder.remove(menu: .format)
builder.remove(menu: .toolbar)
builder.remove(menu: .help)
View Credits.html
<html>
<head>
<style>
:root {
color-scheme: light dark;
}
body {
font-family: -apple-system;
font-size: 10pt;
@vtourraine
vtourraine / clean_booted_sim_status_bar
Last active Nov 20, 2019
Clean the iOS Simulator status bar for the currently booted simulator
View clean_booted_sim_status_bar
xcrun simctl status_bar `xcrun simctl list devices | grep "Booted" | sed -e 's/.* (\(.*\)) (Booted.*/\1/'` override --time "9:41" --batteryState charged --batteryLevel 100 --cellularBars 4
@vtourraine
vtourraine / CloudsView.swift
Created Aug 23, 2018
View with clouds floating by.
View CloudsView.swift
//
// CloudsView.swift
//
// Swift 4.2
//
import UIKit
@available(iOS 10.0, *)
class CloudsView: UIView {
@vtourraine
vtourraine / NetworkManager.h
Created Mar 8, 2018
Test block as parameter with OCMock
View NetworkManager.h
//
// NetworkManager.h
//
@import Foundation;
@interface NetworkManager : NSObject
- (void)fetchDataCompletion:(void(^)(NSString *))completion;
- (void)GET:(NSString *)path completion:(void(^)(NSData *))completion;
@vtourraine
vtourraine / sync_versions.sh
Last active Feb 16, 2018
Run Script: Sync Version and Build Numbers
View sync_versions.sh
PLISTBUDDY="/usr/libexec/PlistBuddy"
MAIN_APP_PLIST_PATH="###/Info.plist"
EXTENSIONS_PLIST_PATHS=("###/Info.plist" "###/Info.plist")
BUNDLEVERSION=`${PLISTBUDDY} -c "Print :CFBundleVersion" "$MAIN_APP_PLIST_PATH"`
BUNDLEVERSIONSTRING=`${PLISTBUDDY} -c "Print :CFBundleShortVersionString" "$MAIN_APP_PLIST_PATH"`
for EXTENSIONS_PLIST_PATH in "${EXTENSIONS_PLIST_PATHS[@]}"
do
@vtourraine
vtourraine / keybase.md
Created Apr 6, 2016
Keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am vtourraine on github.
  • I am vtourraine (https://keybase.io/vtourraine) on keybase.
  • I have a public key whose fingerprint is 700B 4ED7 8DA6 260B E442 FF05 EF05 AC72 1024 1BA4

To claim this, I am signing this object:

@vtourraine
vtourraine / OnboardingViewController.swift
Created Mar 23, 2016
ResearchKit onboarding controller managing consent.
View OnboardingViewController.swift
//
// OnboardingViewController.swift
// MyStudyApp
//
// Created by Vincent Tourraine on 2/8/16.
// Copyright © 2016 Shazino. All rights reserved.
//
import UIKit
import ResearchKit
@vtourraine
vtourraine / Interface.storyboard
Created Mar 8, 2016
Games Keeper for Apple Watch
View Interface.storyboard
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="AgC-eL-Hgc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="9515"/>
</dependencies>
<scenes>
<!--Games-->
<scene sceneID="aou-V4-d1y">
<objects>
@vtourraine
vtourraine / ActivitiesViewController.swift
Created Feb 25, 2016
ResearchKit activities controller managing a survey.
View ActivitiesViewController.swift
//
// ActivitiesViewController.swift
// MyStudyApp
//
// Created by Vincent Tourraine on 2/8/16.
// Copyright © 2016 Shazino. All rights reserved.
//
import UIKit
import ResearchKit