This file contains 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
setInterval (-> | |
Quota.get().then (quotas) -> $scope.quotas = quotas | |
), 20000 |
This file contains 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
# 1) Add to your root .js file (like application.js): | |
//= require ckeditor/override | |
//= require ckeditor/init | |
#2) Create new .rake task in this code to your "lib" folder: | |
namespace :ckeditor do | |
desc 'Create nondigest versions of some ckeditor assets (e.g. moono skin png)' | |
task :create_nondigest_assets do |
This file contains 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
# Add config.assets.precompile += Ckeditor.assets to application.rb | |
# Add gem 'turbo-sprockets-rails3' to my Gemfile under :assets group. | |
# Removed unused Gems from Gemfile. | |
# Bundle Install | |
# Remove the following lines from active_admin.js.coffee: | |
//= require active_admin/base | |
//= require ckeditor/override | |
//= require ckeditor/init |
This file contains 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
class DomainConfig | |
def initialize(config) | |
@config = config | |
end | |
def hosta | |
return @config["host"][Rails.env] || 'example1.dev' | |
end |
This file contains 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
100.times do |i| | |
User.create!(username: "username#{i}", email: "user#{i}@hudgens.com", password: "secret123", password_confirmation: "secret123") | |
end | |
10.times do |j| | |
Friendship.create!(user_id: User.first.id, friend_id: User.find(j + 1).id, authorized: true) | |
end | |
programming_category = Category.create!(title: "Programming") | |
sports_category = Category.create!(title: "Sports") |
This file contains 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
# Run this command to create a database backup | |
$ heroku pgbackups:capture | |
# Run this to download the database dump locally | |
$ curl -o latest.dump `heroku pgbackups:url` | |
# Run this to restore the db contents locally (substituting myuser/mydb to match the database.yml file contents) | |
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump |
This file contains 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
getParameterByName = (name) -> | |
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]') | |
regex = new RegExp('[\\?&]' + name + '=([^&#]*)') | |
results = regex.exec(location.search) | |
if results == null then '' else decodeURIComponent(results[1].replace(/\+/g, ' ')) | |
# --- | |
# generated by js2coffee 2.0.3 | |
autoSaveBookChapter = -> |
This file contains 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 self.fetch_studio_schedule(*opts) | |
options = opts.extract_options! | |
start_date = options[:start_date] || Date.today | |
end_date = options[:end_date] || Date.today + 2.weeks | |
message = { | |
StartDateTime: start_date, | |
EndDateTime: end_date, | |
HideCanceledClasses: false | |
} |
This file contains 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
sampleExerciseSave = -> | |
$.ajax | |
type: 'POST' | |
url: '/scores/new' | |
data: $('.edit_book_chapter').serialize() | |
dataType: 'script' | |
success: (data) -> | |
return |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","errorBeacon":"bam.nr-data.net","licenseKey":"88ed96912f","applicationID":"4229176","transactionName":"ewsMREVbW19dRkpaQFwBEEMYQF9SVl8W","queueTime":0,"applicationTime":685,"agent":"js-agent.newrelic.com/nr-632.min.js"}</script> | |
<script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(e,n,t){function r(t){if(!n[t]){var o=n[t]={exports:{}};e[t][0].call(o.exports,function(n){var o=e[t][1][n];return r(o?o:n)},o,o.exports)}return n[t].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<t.length;o++)r(t[o]);return r}({QJf3ax:[function(e,n){function t(e){function n(n,t,a){e&&e(n,t,a),a||(a={});for(var u=c(n),f=u.length,s=i(a,o,r),p=0;f>p;p++)u[p].apply(s,t);return s}function a(e,n){f[e]=c(e).concat(n)}function c(e){return f[e]||[]}function u(){return t(n)}var f={};return{on:a,emit:n,create:u,listeners:c,_events:f}}function r(){return{}}var o="nr@ |