Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Freitas Thunor

  • Waterloo, NE
View GitHub Profile
@Thunor
Thunor / NavigationBarTitleStyle.swift
Created Sep 29, 2020
Style the NavigationBar Title in SwiftUI
View NavigationBarTitleStyle.swift
struct MyView: View {
var body: some View {
VStack {
Text("Hello World")
}
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .principal) {
HStack {
@Thunor
Thunor / UINavigation+Appearance.swift
Last active Sep 29, 2020
Modify the NavigationBar in SwiftUI
View UINavigation+Appearance.swift
import Foundation
import UIKit
extension UINavigationController {
override open func viewDidLoad() {
super.viewDidLoad()
let appearance = UINavigationBarAppearance()
//background color of the navigation and status bar
@Thunor
Thunor / podforceupdate.sh
Created Feb 12, 2020 — forked from mbinna/podforceupdate.sh
Clear CocoaPods cache, re-download and re-install all pods
View podforceupdate.sh
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
View gist:046d1c1c0da243e37a871467d58b32d0
### Keybase proof
I hereby claim:
* I am thunor on github.
* I am eric_freitas (https://keybase.io/eric_freitas) on keybase.
* I have a public key ASApoyy8EwJdq4RxBL0EgUCnBg0NTznDAAp0Am0BvQ2muQo
To claim this, I am signing this object:
@Thunor
Thunor / TimePicker24HRenderer.cs
Created Jun 15, 2017 — forked from Sankra/TimePicker24HRenderer.cs
Custom renderer for Xamarin.Forms TimePicker on iOS. This will make the TimePicker always show time using 24H format (aka no AM or PM).
View TimePicker24HRenderer.cs
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using PersonalTrainer.iOS.View.Controls;
[assembly: ExportRenderer (typeof (TimePicker), typeof (TimePicker24HRenderer))]
namespace YourNamespace.iOS.View.Controls {
public class TimePicker24HRenderer : TimePickerRenderer {
@Thunor
Thunor / ALLOY.md
Created Jan 20, 2017 — forked from kbshl/ALLOY.md
If you want to your CommonJS modules to work in both Alloy and plain Titanium projects, you might need a way to detect if you're in Alloy. For instance, if you're in Alloy you would get Underscore from the alloy-module, while in plain Titanium you would require Underscore directly.
View ALLOY.md

If you want to your CommonJS modules to work in both Alloy and plain Titanium projects, you might need a way to detect if you're in Alloy. For instance, if you're in Alloy you would get Underscore from the alloy-module, while in plain Titanium you would require Underscore directly.

Well, you can:

var _ = require((typeof ENV_TEST === 'boolean') ? 'alloy' : 'underscore')._;

The above works by utilizing Alloy's optimization process. In this process, constants like ENV_TEST will be either TRUE or FALSE. The actual expressions in wich they are used will then be evaluated. If FALSE the code block will be removed. In plain Titanium projects the constants are undefined and this typeof ENV_TEST will be undefined, so the code block will be executed.

@Thunor
Thunor / background_demo.js
Created Jan 20, 2017 — forked from kosso/background_demo.js
Background Service notification for Titanium
View background_demo.js
/* Kosso : March 12th 2011
This the only way I managed to do this without the app crashing on resume.
Done slightly differently to the KS example, since they unregister the service and
do not use a setInterval timer.
*/
//############ in app.js :
// test for iOS 4+
@Thunor
Thunor / gist:dc03359496d40174f5f5
Last active Oct 22, 2015 — forked from rgcottrell/gist:5b876d9c5eea4c9e411c
An FM Synthesizer in Swift using AVAudioEngine
View gist:dc03359496d40174f5f5
import AVFoundation
import Foundation
// The maximum number of audio buffers in flight. Setting to two allows one
// buffer to be played while the next is being written.
private let kInFlightAudioBuffers: Int = 2
// The number of audio samples per buffer. A lower value reduces latency for
// changes but requires more processing but increases the risk of being unable
// to fill the buffers in time. A setting of 1024 represents about 23ms of
View LICENSE
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
You can’t perform that action at this time.