Skip to content

Instantly share code, notes, and snippets.

View talsafran's full-sized avatar

Tal Safran talsafran

View GitHub Profile
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.
EVENT_TRANSLATIONS = {
'users#create' => 'User Created',
'users#update' => 'User Updated',
'orders#new' => 'Order Started',
'orders#create' => 'Order Created',
'orders#update' => 'Order Updated'
}
class ApplicationController < ActionController::Base
after_action :track_event
private
def track_event
mixpanel.track(event_user, event_name)
end
def event_user
class ApplicationController < ActionController::Base
...
private
def track_event
mixpanel.track(event_user, event_name, event_properties)
end
def event_properties
# 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
class ApplicationController < ActionController::Base
...
def track_event
mixpanel.track(event_user, event_name, event_properties)
end
handle_asynchronously :track_event
...
end
# 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 December 9, 2011 22:13
HTML code from Hursh and Tal's Skillshare Class
<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 December 9, 2011 22:15
CSS code from Hursh and Tal
body {
text-align: center;
}
#container {
font-family: arial;
margin-top: 200px;
}
#search-text {