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="../topeka-elements/category-images.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../core-icons/av-icons.html"> | |
<link rel="import" href="../paper-fab/paper-fab.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> |
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/env ruby | |
require 'fileutils' | |
require 'tmpdir' | |
removed_dirs = `svn st`.lines.map do |line| | |
if line =~ /^!\s*(.*)$/ | |
$1 | |
end | |
end.compact |
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/env ruby | |
external_dirs = `svn st`.lines.map do |line| | |
if line =~ /^Performing status on external item at '([^']*)'$/ | |
$1 | |
end | |
end.compact | |
external_dirs.each do |dir| | |
system "svn revert -R '#{dir}'" |
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/env ruby | |
require 'fileutils' | |
require 'tmpdir' | |
def ignored?(entry) | |
['.', '..', '.svn'].include? entry | |
end | |
def replicate_dir_contents(old_dir, new_dir) | |
unless File.directory? new_dir |
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
public class LessThanOrEqualFilterRule : IFilterRule | |
{ | |
public IEnumerable<Widget> Filter(IEnumerable<Widget> widgets) | |
{ | |
return widgets.Where(w => w.foo <= 100); | |
} | |
} | |
public class EqualFilterRule : IFilterRule | |
{ |
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
# Boo | |
a = ( (1, 2), (3, 4) ) | |
for i, j in a: # Boo supports unpacking! | |
print(i + j) | |
// C# | |
var arr = new int[][] { new int[] { 1, 2 }, new int[] { 3, 4 } }; | |
foreach (var x in arr) | |
{ | |
// No unpacking, must use array indices... | |
Console.WriteLine(x[0] + x[1]); |
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 "csv" | |
class AwesomeCsvReader | |
def initialize(importer) | |
@importer = importer | |
end | |
def read | |
CSV.foreach "large.csv" do |line| | |
@importer.import line |
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 'ostruct' | |
class HockeyClient | |
def listen_for_hockey_scores | |
return enum_for(:listen_for_hockey_scores) unless block_given? | |
sleep 1 | |
yield score "Blues", "Cracknell" | |
sleep 0.1 | |
yield score "Red Wings", "Salei" | |
sleep 0.1 |
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 'ostruct' | |
class HockeyClient | |
def listen_for_hockey_scores | |
sleep 1 | |
yield score "Blues", "Cracknell" | |
sleep 0.1 | |
yield score "Red Wings", "Salei" | |
sleep 0.1 | |
yield score "Red Wings", "Helm" |
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 'ostruct' | |
class HockeyClient | |
def listen_for_hockey_scores | |
sleep 1 | |
yield score "Blues", "Cracknell" | |
sleep 0.1 | |
yield score "Red Wings", "Salei" | |
sleep 0.1 | |
yield score "Red Wings", "Helm" |
NewerOlder