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
import sublime, sublime_plugin | |
class DuplicateLineCommand(sublime_plugin.TextCommand): | |
def run(self, edit, direction='down'): | |
self.view.run_command("expand_selection", {"to": "line"}) | |
view = self.view | |
for region in self.view.sel(): | |
line = region | |
if line.empty(): |
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 "json" | |
require "rake-pipeline-web-filters" | |
class HandlebarsFilter < Rake::Pipeline::Filter | |
def initialize(&block) | |
block ||= proc { |input| input.sub(/\.handlebars$/, '.js') } | |
super(&block) | |
end | |
def generate_output(inputs, output) | |
inputs.each do |input| |
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 "uglifier" | |
require "rake-pipeline-web-filters" | |
class UglifyFilter < Rake::Pipeline::Filter | |
def initialize() | |
super() | |
end | |
def generate_output(inputs, output) | |
inputs.each do |input| |
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
source "http://rubygems.org" | |
gem "rack" | |
gem "tilt" | |
gem "sass" | |
gem "compass" | |
gem "coffee-script" | |
gem "uglifier" | |
gem "rake-pipeline", :git => "https://github.com/livingsocial/rake-pipeline.git" | |
gem "rake-pipeline-web-filters", :git => "https://github.com/wycats/rake-pipeline-web-filters.git" |
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 "json" | |
require "uglifier" | |
require "rake-pipeline-web-filters" | |
# this gives you concat, coffee_script, and minispade methods | |
require "rake-pipeline-web-filters/helpers" | |
class HandlebarsFilter < Rake::Pipeline::Filter | |
def initialize(&block) | |
block ||= proc { |input| input.sub(/\.handlebars$/, '.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
<!doctype html> | |
<!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]--> <!--[if IE 7 ]> <html lang="en" class="ie7"> <![endif]--> <!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]--> <!--[if IE 9 ]> <html lang="en" class="ie9"> <![endif]--> | |
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="author" content=""> |
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
PP = {}; | |
// http://stackoverflow.com/questions/3075308/what-modernizer-scripts-exist-for-the-new-ecmascript-5-functions/3075818#3075818 | |
PP.object = { | |
}; | |
PP.object.create = function(o) | |
{ | |
function F() | |
{ | |
}; | |
F.prototype = o; |
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 ImportFilter < Rake::Pipeline::Filter | |
def generate_output(inputs, output) | |
inputs.each do |input| | |
path = input.root + "/" + input.path.sub(/[^\/]+\.\w+/, "") | |
print "#{path}\n" | |
output.write input.read.gsub(/(@import\s+\"([^\"]+)\";)/) { | |
File.read("#{path}#{$2}") | |
} | |
end | |
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
match "**/*.js" do | |
# block so uglify doesn't change name | |
uglify do |input| | |
input | |
end | |
# immediate has to come before modernizr | |
# block to filter if files even end up in a file at all | |
# need to decide between immediate and main (top of bottom of html file) | |
concat ['immediate.js', 'modernizr-2.0.min.js'], do |filename| | |
immedateGroup = ['immediate.js', 'modernizr-2.0.min.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
class GzipFilter < Rake::Pipeline::Filter | |
processes_binary_files | |
def generate_output(inputs, output) | |
inputs.each do |input| | |
strio = StringIO.open('','w') | |
gz = Zlib::GzipWriter.new(strio) | |
gz.write(input.read) | |
gz.close | |
output.write strio.string | |
end |
OlderNewer