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
<link rel="import" href="../paper-tabs/paper-tabs.html"> | |
<link rel="import" href="../paper-tabs/paper-tab.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
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
/** | |
* @param {number[]} nums | |
* @return {string} | |
*/ | |
var largestNumber = function(nums) { | |
return nums | |
.sort(function(a, b) { return ( (b + '' + a) - (a + '' + b) ); }) | |
.join('') | |
.replace(/^0*/,'') || '0'; | |
}; |
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
desc "Generate and deploy assets" | |
task :deploy_assets, :roles => :app do | |
# get the previous timestamp | |
old_timestamp = File.read("config/deploy_timestamp").to_i rescue 0 | |
# generate timestamp into config/deploy_timestamp | |
timestamp = Time.now.to_i | |
File.open("config/deploy_timestamp", 'w') do |f| | |
f.write(timestamp) | |
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
#!/usr/bin/ruby | |
require "rubygems" | |
require "hpricot" | |
require "open-uri" | |
require "builder" | |
require "httpclient" | |
require "yaml" | |
require "cgi" |
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
google.pacman || | |
function () { | |
var a = true, | |
e = false, | |
g = {}, | |
i = [1, 4, 2, 8], | |
l = { | |
0 : { | |
axis: 0, | |
increment: 0 |
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
require "rubygems" | |
require "backchat" | |
BackChat.connect("fred.dagg", "3b43ebca5e9703bbbeb5d0f87c87c962") | |
BackChat.stream("an-example-stream-name") do |msg| | |
puts "#{msg.sender.name} just posted a message" | |
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
curl -H 'Authorization: Backchat 3b43ebca5e9703bbbeb5d0f87c87c962' https://stream.backchat.io/example-stream-name |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Create an EC2 instance running the Amazon Linux 32 bit AMI. The AMI is chosen based on the region in which the stack is run. This example creates an EC2 security group for the instance to give you SSH access.", | |
"Parameters" : { | |
"KeyName" : { | |
"Description" : "Name of and existing EC2 KeyPair to enable SSH access to the instance", | |
"Type" : "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
# TODO: include gems in package | |
require 'rubygems' | |
require 'growl' | |
require 'net/http' | |
require 'net/https' | |
require 'yajl/json_gem' | |
# TODO: Read from ~/.backchatio_notifier file | |
API_KEY="YOUR_API_KEY_HERE" | |
STREAM_SLUG="controlbox" |
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
require 'Date' | |
# precondition: assumed days_of_our_lives is defined as a range, and | |
# purpose? method is defined (left as an exercise for the implementor) of this class. | |
days_of_our_lives.reduce do |life, time| | |
level += 1 and eat 'cake' if Date.today.day == 10 && Date.today.month == 12 | |
purpose?(life, time) | |
end |
OlderNewer