# http://www.conservative.ca/team/member/?fname=Arnold&lname=Viersen&type=candidates
span = page.xpath('//span[@class="__cf_email__"]/@data-cfemail')
code = span[0]
operand = int(code[:2], 16)
return ''.join(chr(int(code[i:i + 2], 16) ^ operand) for i in range(2, len(code), 2))
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
# Run all these commands with the `-s` flag. | |
# Prints the status of all unclean repositories. | |
status: | |
for dir in */; do \ | |
if [ -d $$dir/.git ]; then \ | |
cd $$dir; \ | |
if [[ ! -z `git st` ]]; then \ | |
echo $$dir; \ | |
git st; \ |
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
# Prints the top 10 users who contribute to the most civic tech repositories | |
# outside their home organization(s). If you'd like to print the top 15, run: | |
# | |
# ruby stefan_baack.rb 15 | |
# | |
# To see the top 3 organizations to which each user contributed, run: | |
# | |
# ruby stefan_baack.rb 10 3 | |
# | |
# @see http://sbaack.com/2015/11/19/scraping-the-global-civic-tech-community-on-github-part-2.html |
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
// Old member | |
{ | |
"organization_id": "house-of-commons", | |
"person_id": "john-doe", | |
"end_event": "john-doe-resigns" | |
} | |
// Resignation | |
{ | |
"id": "john-doe-resigns", |
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
// Acme Ltd organization | |
{ | |
"id": "acme-ltd", | |
"name": "Acme Ltd" | |
} | |
// Board of Directors sub-organization | |
{ | |
"id": "acme-board", | |
"name": "Board of Directors", |
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 class="no-js" lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<title>Test</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> |
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
source 'https://rubygems.org' | |
gem 'data_mapper' | |
gem 'dm-postgres-adapter' |
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
-- MySQL dump 10.13 Distrib 5.5.31, for debian-linux-gnu (x86_64) | |
-- | |
-- Host: localhost Database: edgarapi_live | |
-- ------------------------------------------------------ | |
-- Server version 5.5.31-0ubuntu0.13.04.1-log | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
/*!40101 SET NAMES utf8 */; |
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> | |
<meta charset="utf-8"> | |
<style> | |
.text | |
{ | |
width: 50%; | |
float: left; | |
font: 300 16px/23px Helvetica,Arial,sans-serif; | |
} | |
.text-del |
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
diff --git a/app/assets/javascripts/rangeslider.js b/app/assets/javascripts/rangeslider.js | |
index 1531b77..9637194 100644 | |
--- a/app/assets/javascripts/rangeslider.js | |
+++ b/app/assets/javascripts/rangeslider.js | |
@@ -107,7 +107,7 @@ | |
this.identifier = 'js-' + pluginName + '-' +(pluginIdentifier++); | |
this.min = parseFloat(this.$element[0].getAttribute('min') || 0); | |
this.max = parseFloat(this.$element[0].getAttribute('max') || 100); | |
- this.value = parseFloat(this.$element[0].value || this.min + (this.max-this.min)/2); | |
+ this.value = parseFloat(this.$element[0].getAttribute('value') || this.min + (this.max - this.min) / 2); |