This file contains hidden or 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
| def live_release(course_id, do_emails = true, do_push = true) | |
| course = Course.find course_id | |
| emails_sent = pushes_sent = 0 | |
| enrollments = course.enrollments.where(is_complete: false).each do |e| | |
| # check the course for new questions and add them to the enrollment | |
| e.last_new_introduced = nil | |
| e.check_questions |
This file contains hidden or 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 'google/apis/admin_directory_v1' | |
| require 'googleauth' | |
| require 'googleauth/stores/file_token_store' | |
| require 'fileutils' | |
| OOB_URI = 'urn:ietf:wg:oauth:2.0:oob' | |
| APPLICATION_NAME = 'Directory API Ruby Quickstart' | |
| CLIENT_SECRETS_PATH = 'client_secret.json' | |
| CREDENTIALS_PATH = File.join(Dir.home, '.credentials', "admin-directory_v1-ruby-quickstart.yaml") |
This file contains hidden or 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 "mechanize" | |
| require "nokogiri" | |
| require 'json' | |
| require "awesome_print" | |
| def get_latest | |
| url = "http://medium.com/@heyellieday" | |
| agent = Mechanize.new { |agent| agent.user_agent_alias = "Mac Safari" } | |
| html = agent.get(url).body |
This file contains hidden or 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
| alfred://customsearch/Flickr%20Creative%20Commons/flickr/utf8/plus/http://www.flickr.com/search/?q={query}&l=cc&ss=2&ct=0&mt=all&w=all&adv=1 |
This file contains hidden or 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 python | |
| import redis | |
| import random | |
| import pylibmc | |
| import sys | |
| r = redis.Redis(host = 'localhost', port = 6389) | |
| mc = pylibmc.Client(['localhost:11222']) |
This file contains hidden or 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
| import re | |
| # http://atomboy.isa-geek.com/plone/Members/acoil/programing/double-metaphone | |
| from metaphone import dm as double_metaphone | |
| # get the Redis connection | |
| from jellybean.core import redis | |
| import models | |
| # Words which should not be indexed |