// jQuery
$(document).ready(function() {
// code
})
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
BEFORE YOU CONTINUE:
- Now, Meteor runs in any Windows without any line of this tutorial. Just download the Meteor binary! Yay!!
mrt
is no longer used with Meteor 1.0
These days some people were discussing at meteor-talk group about running Meteor at Windows and I’ve recommended them using Vagrant. It’s a very developer-friendly piece of software that creates a virtual machine (VM) which let you run any operating system wanted and connect to it without big efforts of configuration (just make the initial installation and you have it working).
Many packages (I've tested) for running Meteor+Vagrant fails because Meteor writes its mongodb file and also other files inside local build folder into a shared folder between the Windows host and the Linux guest, and it simply does not work. So I've put my brain to work and found a solution: do symlinks inside the VM (but do not use ln. Use mount so git can follow it). It’s covered on
module AssetHelper | |
## | |
# Renders a stylesheet asset inline. | |
def inline_stylesheet( name ) | |
content_tag :style do | |
sprockets[ "#{name}.css" ].to_s | |
end | |
end |
We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
Serving Rails static assets is hard, especially on Heroku Cedar where Heroku forces Rails to serve static assets itself (which isn't particularly performant nor worth your dyno-dollar)---this is different than Heroku Bamboo which used Varnish and is no more. To make the best of the situation, I highly recomend:
-
Using the Heroku-Deflater gem which will selectively gzips assets (it gzips text-based files; and excludes images or binary files, which can actually be bigger when gzipped)
-
Configure your production environment to set cache-control headers and get out of denial about how static assets are being served on Heroku Cedar
-
Use AWS Cloudfront (or a CDN of your choosing) to serve the assets. Cloudfront is great because you can use the same Distribution
(Full description and list of commands at - https://npmjs.org/doc/index.html)
Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:
def resize_nocrop_noscale(image, w,h) | |
w_original = image[:width].to_f | |
h_original = image[:height].to_f | |
if w_original < w && h_original < h | |
return image | |
end | |
# resize | |
image.resize("#{w}x#{h}") |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
def fb_liked? | |
session[:signed_request]['page']['liked'] if session[:signed_request] | |
end | |
def fb_admin? | |
session[:signed_request]['page']['admin'] if session[:signed_request] | |
end |
t = 236 # seconds | |
Time.at(t).utc.strftime("%H:%M:%S") | |
=> "00:03:56" | |
# Reference | |
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time |