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
clean_snippet: function(snippet){ | |
snippet = snippet.replace(/'/gi, "("); // single quote will cause javascript problems inline. | |
snippet = snippet.replace(/[\t\n\r]/gi, ""); // remove tabs, newlines, and return chars | |
return this.rewrite_links(snippet); | |
}, | |
// Rewrite links in the snippets so they go back to the parent site. | |
rewrite_links: function(snippet){ | |
var obj = jQuery(snippet); | |
obj.find('[href]').attr('href', function(){ return com.oerglue.browser.make_abs_url(this.href); }); |
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
clean_snippet: function(snippet){ | |
snippet = snippet.replace(/'/gi, "("); // single quote will cause javascript problems inline. | |
snippet = snippet.replace(/[\t\n\r]/gi, ""); // remove tabs, newlines, and return chars | |
return this.rewrite_links(snippet); | |
}, | |
// Rewrite links in the snippets so they go back to the parent site. | |
rewrite_links: function(snippet){ | |
var obj = jQuery(snippet); | |
obj.find('[href]').attr('href', function(){ return com.oerglue.browser.make_abs_url(this.href); }); |
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
jQuery.fn.outerHtml = function(include_scripts) { | |
if(include_scripts === undefined){ include_scripts = false; } | |
var clone = this.clone(); | |
var items = jQuery.map(clone, function(element){ | |
if(jQuery.nodeName(element, "script")){ | |
if(include_scripts){ | |
var attributes; | |
if(element.attributes){ | |
attributes = jQuery.map(element.attributes, function(attribute){ | |
return attribute.name + '="' + attribute.value + '" '; |
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
node public/oerglue_js/app.build.js | |
/Users/jbasdf/projects/oerglue_proxy/public/oerglue_js/min-main-edit.js | |
---------------- | |
/Users/jbasdf/projects/oerglue_proxy/public/oerglue_js/libs/require/almond.js | |
/Users/jbasdf/projects/oerglue_proxy/public/oerglue_js/libs/jquery/jquery.js | |
/Users/jbasdf/projects/oerglue_proxy/public/oerglue_js/libs/underscore/underscore.js | |
/Users/jbasdf/projects/oerglue_proxy/public/oerglue_js/libs/backbone/backbone.js | |
/Users/jbasdf/projects/oerglue_proxy/public/oerglue_js/libs/utils/common.js | |
/Users/jbasdf/projects/oerglue_proxy/public/oerglue_js/libs/cookies.js |
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
require 'rack/utils' | |
require 'rack/session/abstract/id' | |
require 'remcached' | |
require 'em-synchrony/em-remcached' | |
module Slurper | |
module Rack | |
class Session < ::Rack::Session::Abstract::ID | |
include Goliath::Rack::AsyncMiddleware |
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
require 'rack/utils' | |
require 'rack/session/abstract/id' | |
require 'remcached' | |
require 'em-synchrony/em-remcached' | |
module Slurper | |
module Rack | |
class Session < ::Rack::Session::Abstract::ID | |
include Goliath::Rack::AsyncMiddleware |
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
launch "iTerm" | |
tell application "iTerm" | |
activate | |
------------------------------------ | |
-- create the Open Tapestry tabs | |
tell the first terminal | |
-- set terminal size |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'exifr' | |
require 'fileutils' | |
require 'logger' | |
class PictureScanner | |
def self.scan_files(source_dir) | |
cameras = {} |
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
namespace :ember do | |
desc "Build ember models from schema" | |
task :models => :environment do | |
# Change these values to fit your project | |
namespace = 'App' # The Ember application's namespace. | |
output_dir = File.join(Rails.root, "app/assets/javascripts/common/models") # The directory where ember models will be written | |
schema_file = File.join(Rails.root, 'db/schema.rb') |
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
namespace :ember do | |
desc "Build ember models from schema" | |
task :models => :environment do | |
# Change these values to fit your project | |
namespace = 'App' # The Ember application's namespace. | |
# The directory where ember models will be written. We drop them | |
# in the tmp directory since we might not want an ember model for every table in the |
OlderNewer