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
void ShowStuff () | |
{ | |
var client = new WebClient (); | |
var content = JsonValue.Parse (client.DownloadString ("http://api.worldbank.org/countries?format=json&per_page=50")); | |
int number_of_countries = content [0] ["total"]; | |
int done = 0, error = 0; | |
InvokeOnMainThread (() => { | |
CountriesLabel.Text = string.Format ("Countries: {0} done: 0 error: 0", number_of_countries); | |
}); |
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
async Task ShowStuffAsync () | |
{ | |
var client = new HttpClient (); | |
var content = JsonValue.Parse (await client.GetStringAsync ("http://api.worldbank.org/countries?format=json")); | |
int number_of_countries = content [0] ["per_page"]; | |
int done = 0, error = 0; | |
CountriesLabel.Text = string.Format ("Countries: {0} done: 0 error: 0", number_of_countries); |
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
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
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 | |
# Pre-commit hook for removing trailing whitespace, converting tabs to | |
# spaces and removing blank lines at the end of a file. | |
# | |
# Author: Clifton King <[email protected]> | |
# gist: https://gist.github.com/3173611 | |
if File.exists? '.git/merge-rebase' | |
puts "Detected '.git/merge-rebase'! Skipping pre-commit hook..." |
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
module Sass::Script::Functions | |
def user_color | |
color_values = options[:custom][:user].color. | |
scan(/^#?(..?)(..?)(..?)$/).first. | |
map {|num| num.ljust(2, num).to_i(16)} | |
Sass::Script::Color.new(color_values) | |
end | |
end |