Legend:
- ✏️ method changes
this
. - 🔒 method does not change
this
.
Array<T>.prototype.*
:
concat(...items: Array): T[]
🔒 ES3
view_assigns = {widgets: Widget.all} | |
av = ActionView::Base.new(ActionController::Base.view_paths, view_assigns) | |
av.class_eval do | |
# include any needed helpers (for the view) | |
include ApplicationHelper | |
end | |
# normal render statement | |
content = av.render template: 'widgets/index.xlsx.axlsx' | |
# do something with content, such as: |
Here is a simple jQuery plugin to make a table header fixed on top of a div when this is scrolled. | |
Using the code from twitter bootstrap documentation page, this code is customized for table header. | |
Create the table with the table-fixed-header class and a thead tag: | |
<table class="table table-striped table-fixed-header" id="mytable"> | |
<thead class="header"> | |
<tr> | |
<th>Email Address</th> | |
<th>First Name</th> | |
<th>Last Name</th> |
def self.circle_path(center, radius, complete_path = false) | |
# For increased accuracy, if your data is in a localized area, add the elevation in meters to r_e below: | |
r_e = 6378137.0 | |
@@d2r ||= Math::PI/180 | |
@@multipliers ||= begin | |
segments = 16 | |
dRad = 2*Math::PI/segments | |
(segments + (complete_path ? 1 : 0)).times.map do |i| | |
rads = dRad*i | |
y = Math.sin(rads) |
require 'axlsx' | |
title = "Some report" | |
selected_columns = %w(one two three four five) | |
Axlsx::Package.new do |package| | |
package.workbook do |workbook| | |
# Disabling this will improve performance for very large documents | |
workbook.use_autowidth = false |
module BootstrapHelper | |
def bootstrap_best_in_place_if(condition, object, field, options = {}) | |
content_tag(:div, class: "control-group string optional #{options.delete(:wrapper_class)}".strip) do | |
label_tag(field, options.delete(:label), class: 'string optional control-label') + | |
content_tag(:div, class: 'controls') do | |
best_in_place_if condition, object, field, options | |
end | |
end | |
end |
function capdu { | |
if [ -z "$1" ] | |
then | |
FILES=`gst | grep modified: | ruby -e 'puts ARGF.map {|l| l.split()[2]}.join(",")' | xargs echo` | |
else | |
FILES=`gst | grep modified: | grep $1 | ruby -e 'puts ARGF.map {|l| l.split()[2]}.join(",")' | xargs echo` | |
fi | |
if [ -z "$FILES" ] | |
then | |
echo "No modified files exist" |
Array.prototype.unique = function() { | |
var o = {}, i, l = this.length, r = []; | |
for(i=0; i<l;i+=1) o[this[i]] = this[i]; | |
for(i in o) r.push(o[i]); | |
return r; | |
}; | |
Array.prototype.values_at = function() { | |
var o = [], i, l = arguments.length; | |
for(i=0; i<l;i+=1) o.push( this[arguments[i]] ); |
// Partial size grid additions | |
// I have found sometimes I need partial spans (e.g. put two fields evenly below a span3 element) | |
// This now generates all spans, even though span4half is the same as span2. It is helpful when generating a page | |
// and you need to have half of an arbitrary span. | |
#gridExtended { | |
.core (@gridColumnWidth, @gridGutterWidth) { | |
// | |
// Partial spans | |
// |
git push -f origin HEAD^:master |