Skip to content

Instantly share code, notes, and snippets.

@evansobkowicz
evansobkowicz / EmbedsViewController.swift
Last active September 2, 2023 18:01
EmbedsViewController Example Code
//
// EmbedsViewController.swift
//
// Created by Evan Sobkowicz.
// Copyright © 2019 Twitter. All rights reserved.
//
import UIKit
import WebKit
import SafariServices
*/15 * * * * php /path/slack-analytics/toppostsrealtime.php
0 15 * * * php /path/slack-analytics/dailydigest.php
@evansobkowicz
evansobkowicz / touch_id.rb
Created April 4, 2015 19:56
RubyMotion Touch ID
# Call touch_id_authenticate
def touch_id_authenticate
context = LAContext.alloc.init
auth_error = nil
reason = 'Authenticate using your fingerprint'
if context.canEvaluatePolicy(LAPolicyDeviceOwnerAuthenticationWithBiometrics, error: auth_error)
context.evaluatePolicy(LAPolicyDeviceOwnerAuthenticationWithBiometrics, localizedReason: reason, reply: lambda do |success, error|
@evansobkowicz
evansobkowicz / share_helper.rb
Created October 5, 2014 21:28
RubyMotion Social Share Helper
module ShareHelper
# Requires Bubble-Wrap
def share_btn
@share_button = set_nav_bar_button :right, system_item: :action, action: :share_action
end
def share_action
self.share(button: @share_button, title: self.get_title, url: self.current_url)