http://guides.rubyonrails.org/layouts_and_rendering.html
- `<%= javascript_include_tag "main" %>``
- `<%= stylesheet_link_tag "main" %>``
<%= image_tag "header.png", alt: "My Image", class: "my-class" %>
- `<%= video_tag "video.mp4" %>``
#!/bin/bash | |
branch_name=$(git branch | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/") | |
echo "Removing old cordova directory" | |
rm -rf cordova | |
echo "Creating cordova app to ${branch_name}..." | |
echo "WARNING: say 'no' to the next prompts" | |
ember generate cordova-init "my.company.${branch_name}" --platform=android |
# Rails Cheat Sheet | |
# and list of helpers worth keeping | |
# command line | |
script/generate controller | |
# route | |
map.root :controller => "controller_name" |
require 'net/http' | |
require 'rack' | |
# todo | |
# - detect ssl | |
# - keepalive? | |
module Rack | |
class Forwarder | |
def initialize(host, port=80) |
<%@page import="com.liferay.portal.kernel.dao.search.RowChecker"%> | |
<%@include file="/html/actions/init.jsp"%> | |
<% | |
PortletURL portletURL = renderResponse.createRenderURL(); | |
String portletURLString = portletURL.toString(); | |
StudentSearchContainer studentSearchContainer = new StudentSearchContainer(renderRequest, portletURL); | |
StudentDisplayTerms displayTerms = (StudentDisplayTerms)studentSearchContainer.getDisplayTerms(); | |
<%@page import="com.liferay.portal.kernel.dao.search.RowChecker"%> | |
<%@include file="/html/actions/init.jsp"%> | |
<% | |
PortletURL portletURL = renderResponse.createRenderURL(); | |
String portletURLString = portletURL.toString(); | |
StudentSearchContainer studentSearchContainer = new StudentSearchContainer(renderRequest, portletURL); | |
StudentDisplayTerms displayTerms = (StudentDisplayTerms)studentSearchContainer.getDisplayTerms(); | |
#!/bin/bash | |
## | |
# MySQL DB dump to Git commit | |
# | |
# Dumps the specified mysql database to the given location and commits it and | |
# the previous database to the Git repository. | |
# | |
# It is assumed you have already setup the Git respository to only be the | |
# a checkout of the database backup location |
http://guides.rubyonrails.org/layouts_and_rendering.html
<%= image_tag "header.png", alt: "My Image", class: "my-class" %>
helpers do | |
# Construct a link to +url_fragment+, which should be given relative to | |
# the base of this Sinatra app. The mode should be either | |
# <code>:path_only</code>, which will generate an absolute path within | |
# the current domain (the default), or <code>:full_url</code>, which will | |
# include the site name and port number. The latter is typically necessary | |
# for links in RSS feeds. Example usage: | |
# | |
# link_to "/foo" # Returns "http://example.com/myapp/foo" | |
# |
require 'rubygems' | |
require 'net/ssh' | |
# Run this on the machine (node) which needs to tunnel out to forward the UI to the remote system (console) | |
Net::SSH.start("remote_host", "remote_user") do |ssh| | |
# since we are running sinatra locally we will forward 43210 on the remote_host to our localhost 4567 | |
# This is effectively the same as: | |
# ssh -R 4567:localhost:43210 remote_user@remote_host | |
ssh.forward.remote(4567, "localhost", 43210) | |
ssh.loop { true } |
// Bug fixes for current versions. | |
// | |
// This server will start a bash shell and expose it | |
// over socket.io to a browser. See ./term.html for the | |
// client side. | |
// | |
// You should probably: | |
// | |
// npm install socket.io |