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 'active_support/time' | |
require 'active_support/duration' | |
require 'test/unit' | |
def process events | |
sorted_events = events.sort_by{ |e| e[:start_at] } | |
point_in_time = Time.now.utc.beginning_of_day | |
results = [] | |
sorted_events.each do |event| | |
start_at = event[:start_at].utc |
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
// (Based on Ethernet's WebClient Example) | |
#include <SPI.h> | |
#include <WiFly.h> | |
#include "Credentials.h" | |
#define RESETLEDPin 13 | |
#define RESETPIN 13 |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:gml="http://www.opengis.net/gml" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0"> | |
<channel> | |
<title>Science: Science Weekly | theguardian.com</title> | |
<link>http://www.theguardian.com/science/series/science</link> | |
<description>Alok Jha and the Guardian's science team bring you the best analysis and interviews from the worlds of science and technology</description> | |
<language>en-gb</language> | |
<copyright>Guardian News and Media Limited or its affiliated companies. All rights reserved. 2013</copyright> | |
<lastBuildDate>Sun, 28 Jul 2013 23:05:21 GMT</lastBuildDate> | |
<doc |
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
apt-get update -y --force-yes && apt-get -y --force-yes install software-properties-common python-software-properties && add-apt-repository -y ppa:mc3man/trusty-media && apt-get -y --force-yes update && apt-get -y --force-yes dist-upgrade && apt-get -y --force-yes install ffmpeg |
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
var NaturalInput = (function (){ | |
function NaturalInput(text) { | |
this.position = 0; | |
this.text = text; | |
this.requirements = this.text.match(/\$\w*/g); | |
this.suggestions = []; | |
this.data = {}; | |
this.requirements.forEach((function(req) { |
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 'httparty' | |
require 'openssl' | |
require 'ox' | |
## | |
# Very simple http client to process signups on BSD API | |
# You need to set ENV vars before start using it | |
# BSD_API_HOST, BSD_APP_ID, BSD_APP_SECRET, BSD_FORM_ID | |
class BSDClient |
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 bash | |
user="$1" | |
if [ -z "$user" ]; then | |
user=ubuntu | |
fi | |
# Enable memory cgroup and swap accounting | |
sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"/g' /etc/default/grub | |
update-grub |
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
# Available versions: http://downloads.eucalyptus.com/software/euca2ools/2.0/source/ | |
export VERSION="2.0.0" | |
export WORKING_DIR=tmp/euca2install | |
mkdir -p ${WORKING_DIR} | |
cd ${WORKING_DIR} | |
# install dependencies | |
# you can also use port instead: sudo port install swig-python | |
brew install swig | |
brew install wget |
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 'twitter' | |
require 'awesome_print' | |
@rest = Twitter::REST::Client.new do |config| | |
config.consumer_key = "XXX" | |
config.consumer_secret = "XXX" | |
config.access_token = "XXX-XXX" | |
config.access_token_secret = "XXX" | |
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/env ruby | |
require 'rubygems' | |
require 'chatterbot/dsl' | |
# | |
# this is the script for the twitter bot johnydoster | |
# generated on 2013-11-01 15:41:39 +0000 | |
# |
NewerOlder