This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :assets do | |
desc 'copy precompiled assets to S3' | |
task :copy_to_s3 => :environment do | |
Rails.logger.info('Copying compiled assets to s3...') | |
s3 = AWS::S3.new | |
bucket = s3.buckets[APP_CONFIG[:rails_assets_bucket]] | |
base_dir = Rails.root.join('public', 'assets').to_s + '/' | |
regexp_extensions = [] | |
['js', 'css', 'html', 'png', 'jpg', 'jpeg', 'gif', 'ttf', 'woff', 'svg', 'eot', 'otf'].each do |ext| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mixpanel.people.set(user_id, properties, nil, '$ignore_time' => true) | |
mixpanel.people.set_once(user_id, properties, nil, '$ignore_time' => true) | |
mixpanel.people.unset(user_id, property, nil, '$ignore_time' => true) | |
mixpanel.people.increment(user_id, { property => value }, nil, '$ignore_time' => true) | |
mixpanel.people.track_charge(user_id, amount, {}, nil, '$ignore_time' => true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mixpanel | |
@mixpanel ||= Mixpanel::Tracker.new(MIXPANEL[:token]) | |
end | |
def user_conversion(user, converted_at = Time.now.in_time_zone('UTC')) | |
properties = { | |
'Converted' => converted_at, | |
'Conversion Delay' => (converted_at.to_date - user.created_at.to_date).to_i | |
} | |
mixpanel.people.set_once(user.id, properties, nil, '$ignore_time' => true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def payment_received(user.id, amount) | |
mixpanel.people.track_charge(user.id, amount, {}, nil, '$ignore_time' => true) | |
mixpanel.track(user.id, 'Payment', 'Action' => 'received', 'Amount' => amount) | |
end | |
def payment_refunded(user, amount) | |
mixpanel.people.track_charge(user.id, -amount, {}, nil, '$ignore_time' => true) | |
mixpanel.track(user.id, 'Payment', 'Action' => 'refunded', 'Amount' => -amount) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if current_user -%> | |
<script> | |
mixpanel.identify('<%= @current_user.id %>'); | |
mixpanel.register(<%= raw JSON.generate(MixHelp.user_supers(@current_user, 'event')) %>); | |
mixpanel.name_tag('<%= @current_user.display_name %>'); | |
mixpanel.people.set(<%= raw JSON.generate(MixHelp.user_supers(@current_user, 'people')) %>); | |
</script> | |
<% end -%> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["ctrl+shift+t"], "command": "delete_trailing_spaces" }, | |
{ "keys": ["ctrl+space"], "command": "exit_insert_mode", | |
"context": | |
[ | |
{ "key": "setting.command_mode", "operand": false }, | |
{ "key": "setting.is_widget", "operand": false } | |
] | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"detect_slow_plugins": false, | |
"file_exclude_patterns": | |
[ | |
"*.log", | |
"*.gif", | |
"*.png", | |
"*.jpg", | |
"*.psd", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -o errexit | |
set -e | |
# Fail fast if we're not on OS X >= 10.6.0. | |
if [ "$(uname -s)" != "Darwin" ]; then | |
echo "Sorry, DevDNS requires Mac OS X to run." >&2 | |
exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.RecipesCtrl = function($scope, $location, Recipe, Ingredient) { | |
$scope.recipes = Recipe.index({}); | |
$scope.recipe = null; | |
$scope.recipeFormVisible = false; | |
$scope.existing_ingredients = []; | |
Ingredient.index(function(ingredients) { | |
return $scope.existing_ingredients = _(ingredients).map(function(ingredient) { | |
return ingredient.name; | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ingredients, recipeModule, recipes; | |
recipeModule = angular.module('recipeModule', ['ngResource']); | |
recipeModule.config([ | |
'$httpProvider', function($httpProvider) { | |
var token; | |
$httpProvider.defaults.headers['common']['Accept'] = 'application/json'; | |
token = $("meta[name='csrf-token']").attr('content'); | |
return $httpProvider.defaults.headers['common']['X-CSRF-Token'] = token; |