Skip to content

Instantly share code, notes, and snippets.

Avatar

Tal Safran talsafran

View GitHub Profile
View Junto Numero Uno
Fire Spinning
Q: How do I hold and spin the poi?
A: You can hold the poi any way that feels comfortable. You can use arm action, wrist action, or a combination of both.
Q: How can I get better at a "triple weave?"
A: Break it down, then reassemble. Learn each individual arm movement, then combine.
J: This may be more suitable for the way I think (breaking things into simple steps, then combining to do something complex)
A: Just go for it. Keep trying together, 'til you get it.
J: Sometimes this approach is faster – you're trying to reach your goal immediately, instead of waiting to perfect steps one at a time.
View 4-sending-custom-properties.rb
class ApplicationController < ActionController::Base
...
private
def track_event
mixpanel.track(event_user, event_name, event_properties)
end
def event_properties
View 5-separating-into-concern.rb
# app/controllers/application_controller.rb
class ApplicationController < ApplicationController
include EventTracking
end
# app/controllers/concerns/event_tracking.rb
module EventTracking
extend ActiveSupport::Concern
# all dat code
View 2-translation-definitions.rb
EVENT_TRANSLATIONS = {
'users#create' => 'User Created',
'users#update' => 'User Updated',
'orders#new' => 'Order Started',
'orders#create' => 'Order Created',
'orders#update' => 'Order Updated'
}
View 3-track-translated-events.rb
class ApplicationController < ActionController::Base
after_action :track_event
private
def track_event
mixpanel.track(event_user, event_name)
end
def event_user
View 6-track-asynchronously.rb
class ApplicationController < ActionController::Base
...
def track_event
mixpanel.track(event_user, event_name, event_properties)
end
handle_asynchronously :track_event
...
end
View breadth-first-analytics.rb
# Read about this technique here:
# https://medium.com/p/e538ed6567a6
class ApplicationController < ActionController::Base
after_filter :track_event
private
EVENT_TRANSLATIONS = {
'users#create' => 'User Created',
@talsafran
talsafran / index.html
Created Dec 9, 2011
HTML code from Hursh and Tal's Skillshare Class
View index.html
<html>
<head>
<title>Shmoogle!</title>
<link rel="stylesheet" type="text/css" href="index.css" />
</head>
<body>
<div id="container">
<img src="http://bit.ly/shmoogle" />
@talsafran
talsafran / index.css
Created Dec 9, 2011
CSS code from Hursh and Tal
View index.css
body {
text-align: center;
}
#container {
font-family: arial;
margin-top: 200px;
}
#search-text {