Skip to content

Instantly share code, notes, and snippets.

View ajfigueroa's full-sized avatar
💭
🤨

Alex Figueroa ajfigueroa

💭
🤨
View GitHub Profile

WWDC 2018 - Introduction to Siri Shortcuts

  • Shortcuts let you expose the capabilities of your apps to Siri
  • Siri surfaces intents that people do with your apps in Search, Watch, and on Lock screen
    • Tapping on a shortcut can open it up inline with rich preview
  • It can also be used with Siri directly and can show a custom view screen
  • Apps can provide custom response dialog
    • It'll say things such as “how long it will take for your coffee to be ready”
  • Users can choose a custom phrase when adding a shortcut to Siri
  • Developers can suggest what phrase to use such as “Coffee time”
2018-02-23T23:01:04.629848+00:00 app[api]: Starting process with command `bundle exec rake evening` by user scheduler@addons.heroku.com
2018-02-23T23:01:07.320730+00:00 heroku[scheduler.4494]: Starting process with command `bundle exec rake evening`
2018-02-23T23:01:08.010493+00:00 heroku[scheduler.4494]: State changed from starting to up
2018-02-23T23:01:10.974965+00:00 heroku[scheduler.4494]: State changed from up to complete
2018-02-23T23:01:10.960542+00:00 heroku[scheduler.4494]: Process exited with status 0
2018-02-24T02:10:07.539069+00:00 app[worker.1]: error sending the telegram notification
2018-02-24T02:10:07.539118+00:00 app[worker.1]: Telegram API has returned the error. (error_code: "502", uri: "https://api.telegram.org/bot{BOT_TOKEN}/getUpdates")
2018-02-24T02:10:07.539122+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/telegram-bot-ruby-0.8.6.1/lib/telegram/bot/api.rb:76:in `call'
2018-02-24T02:10:07.539124+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/telegram-bot-ruby-0.8
##Some points to mention...
##
##The model knows nothing about the view or the controller.
##The view knows nothing about the controller or the model.
##The controller understands both the model and the view.
##
##The model uses observables, essentially when important data is changed,
##any interested listener gets notified through a callback mechanism.
##
##The following opens up two windows, one that reports how much money you
/**
Assume there are two collection views: collectionViewA and collectionViewB and both have the same dataSource (although, they probably shouldn't...)
collectionViewA has registered a UICollectionViewCell class with the reuseIdentifier "CellA".
collectionViewB has registered a UICollectionViewCell class with the reuseIdentifier "CellB".
When dequeueing a cell with a given reuseIdentifier, you should be confident that the collectionView has the reuseIdentifier
you're attempting to dequeue registered to it. That is, ONLY collectionViewA can dequeue a cell with reuseIdentifier "CellA" and ONLY collectionViewB can do the same for "CellB"
Otherwise, a crash will occur.
Notice, how one of the arguments is a collectionView in the UICollectionViewDataSource method below? That is the collectionView that is asking the datasource for a cell which
@ajfigueroa
ajfigueroa / resizableentry.py
Last active July 4, 2017 22:15
A subclass of Tkinters Entry class that allows for dynamic sizing. Assign a delegate, ensure callback is implemented and set offset to desired value to extend to (such as 2 * text length)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import Tkinter as Tk
class ResizeableEntry(Tk.Entry):
"""
Class that adds resizing functionality to the Tkinter Entry class.
Makes callbacks to the delegate on whether it should resize and how much it should.
"""
def __init__(self, parent=None, delegate=None, **options):
@ajfigueroa
ajfigueroa / L4_P1_Q2_view_image
Last active August 29, 2015 13:59 — forked from hiltontj/L4_P1_Q2_view_image
Just tweaking the read in part.
clc; clear all; close all;
res = 512; % # of pixel lines in each dimension
mri_img = zeros(res, res, res); % initialize image 3D vector
file_names = dir;
file_idx = 1;
for i = 1:length(file_names)
name = file_names(i).name;
@ajfigueroa
ajfigueroa / file_search.m
Created April 16, 2014 18:36
Method to read in file directory as a list of char arrays and it can be used to find certain files versus concatenating strings.
clc; clear all; close all;
file_names = dir;
file_idx = 1;
desired_string = 'slice';
for i = 1:length(file_names)
name = file_names(i).name;
if findstr(desired_string, name)
% Do stuff with name here.
@ajfigueroa
ajfigueroa / repmat.vb
Created June 12, 2013 18:36
An implementation I made a while back of the repmat() function since the API I was using did not have it implemented it at the time. I would love to know different ways of approach this problem, it was meant to work with MathNetNumerics library matrices but it can be adjusted to fit a 2D array of any type (not just Doubles).
''' <param name="matrix">The matrix to be tiled</param>
''' <param name="row">The row dimension of result matrix</param>
''' <param name="column">The column dimension of result matrix</param>
''' <returns>The tiled and replicated matrix.</returns>
Function repmat(ByVal matrix As Matrix(Of Double), ByVal row As Integer, ByVal column As Integer) As Matrix(Of Double)
' Initialize the proper dimensions of the new matrix
Dim result As Matrix(Of Double)
result = New DenseMatrix(matrix.RowCount * row, matrix.ColumnCount * column)