if (browser.versions.mobile) {//判断是否是移动设备打开。browser代码在下面 var ua = navigator.userAgent.toLowerCase();//获取判断用的对象 if (ua.match(/MicroMessenger/i) == "micromessenger") { //在微信中打开 } if (ua.match(/WeiBo/i) == "weibo") { //在新浪微博客户端打开 } if (ua.match(/QQ/i) == "qq") { //在QQ空间打开 } if (browser.versions.ios) { //是否在IOS浏览器打开 } if(browser.versions.android){ //是否在安卓浏览器打开 } } else { //否则就是PC浏览器打开 }
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Use Gists to keep track of any information you'd like to remember later on.
From: http://allrecipes.com/Recipe/White-Chocolate-Raspberry-Cheesecake/Detail.aspx
In a medium bowl, mix together cookie crumbs, 3 tablespoons sugar, and melted butter. Press mixture into the bottom of a 9 inch springform pan.
In a saucepan, combine raspberries, 2 tablespoons sugar, cornstarch, and water. Bring to boil, and continue boiling 5 minutes, or until sauce is thick. Strain sauce through a mesh strainer to remove seeds.
Preheat oven to 325 degrees F (165 degrees C). In a metal bowl over a pan of simmering water, melt white chocolate chips with half-and-half, stirring occasionally until smooth.
In a large bowl, mix together cream cheese and 1/2 cup sugar until smooth. Beat in eggs one at a time. Blend in vanilla and melted white chocolate. Pour half of batter over crust. Spoon 3 tablespoons raspberry sauce over batter. Pour remaining cheesecake batter into pan, and again spoon 3 tablespoons raspberry sauce over the top. Swirl batter with the tip of a knife to create a marbled effect.
Bake for 55 to 60 minutes, or until filling is set. Cool, cover with plastic wrap, and refrigerate for 8 hours before removing from pan. Serve with remaining raspberry sauce.
Create documentation for your projects. Like so:
GistBox Clipper is the companion extension to GistBox, the most beautiful way to organize code snippets. It allows a user to create a GitHub Gist from any page on the web.
# Use Gists to store entire functions
class QuickSort
def self.sort!(keys)
quick(keys,0,keys.size-1)
end
private
def self.quick(keys, left, right)
if left < right
pivot = partition(keys, left, right)
quick(keys, left, pivot-1)
quick(keys, pivot+1, right)
end
keys
end
def self.partition(keys, left, right)
x = keys[right]
i = left-1
for j in left..right-1
if keys[j] <= x
i += 1
keys[i], keys[j] = keys[j], keys[i]
end
end
keys[i+1], keys[right] = keys[right], keys[i+1]
i+1
end
end