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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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
body { | |
font-family: sans-serif; | |
} | |
ul { | |
list-style: none | |
} | |
a{ | |
text-decoration: none; |
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.jquery |
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
# mongo_template.rb | |
# fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842) | |
# | |
# To use: | |
# rails project_name -m http://gist.github.com/gists/219223.txt | |
# remove unneeded defaults | |
run "rm public/index.html" | |
run "rm public/images/rails.png" | |
run "rm public/javascripts/controls.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
<% flash.each do |name, msg| %> | |
<% if msg.is_a?(String) %> | |
<div class="alert alert-<%= name == :notice ? "success" : "error" %>"> | |
<a class="close" data-dismiss="alert">×</a> | |
<%= content_tag :div, msg, :id => "flash_#{name}" %> | |
</div> | |
<% 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title><%= content_for?(:title) ? yield(:title) : "RsgTwitterGem" %></title> | |
<%= csrf_meta_tags %> | |
<!-- Le HTML5 shim, for IE6-8 support of HTML elements --> |
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><html lang="en"><body><script> | |
var myObject = {}; | |
var myFunction = function(param1, param2) { | |
//setviacall()'this'points to my Object when function is invoked | |
this.foo = param1; | |
this.bar = param2; | |
console.log(this); //logs Object{foo = 'foo', bar = 'bar'} | |
}; | |
myFunction.call(myObject, 'foo', 'bar'); // invoke function, set this value to myObject | |
console.log(myObject) // logs Object {foo = 'foo', bar = 'bar'} |
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
Sub ImportLargeFile(i As Integer) | |
'Imports text file into Excel workbook using ADO. | |
'If the number of records exceeds 65536 then it splits it over more than one sheet. | |
Dim strFilePath As String, strFilename As String, strFullPath As String | |
Dim lngCounter As Long | |
Dim oConn As Object, oRS As Object, oFSObj As Object | |
'Get a text file name | |
strFullPath = Application.GetOpenFilename("Text Files (*.txt),*.txt", , "Please selec text file...") |
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
Option Explicit | |
Private mlRecordID As Long | |
Private mlParentPtr As Long | |
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _ | |
(dest As Any, Source As Any, ByVal bytes As Long) | |
Private msDte As String | |
Private msClient As String | |
Private msName As String |
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
'将单元格区域插入到一个表的最后 | |
Sub AddRow(sht As Worksheet, rg As Range) | |
Dim shtrn As Integer | |
Dim rn, cn As Integer | |
shtrn = sht.Range("A1").CurrentRegion.Rows.Count | |
rn = rg.Rows.Count | |
cn = rg.Columns.Count | |
rg.Copy sht.Range("A1").Offset(shtrn, 0).Resize(rn, cn) | |
End Sub |
OlderNewer