Skip to content

Instantly share code, notes, and snippets.

View adam-phillipps's full-sized avatar

Adam adam-phillipps

  • NGage
  • Salt Lake City, UT.
View GitHub Profile
@adam-phillipps
adam-phillipps / Create Conversations 0-user_input
Created May 22, 2013 22:54
my first ruby script (sort of like fischer price's "my first big wheel" but it's still exciting to me.
PORTAL_TOKEN = "1~R6LQJOPqzOWXQfLYDTnWXXC8rBnzlfcD9yatg004A7kQlkpEKSk8GtDGERhAJ86K"
PORTAL_AT_TOKEN = "1~4HqG8O8JN1f8H94IkhMYgjxD8LlEcNosQ0AJ7ET3Wh78X54fS6Be3mFHHnMiuiJs"
LOCAL_TOKEN = "1~KtP1voLOAsUkIgqum0qfMZl7N9PaQQhsI9vAhii0UgASIUDW40belLlk0Bhm8Mmi"
BETA_TOKEN = "1~gBl5tEyJ1jcCe8onAgO7rOhp8lo9fm2omVbYISciCa8BrKFJndmTqkUtNdWrJQoF"
PORTAL_URL = "54.243.66.130"
LOCAL_URL = "http://localhost:3000"
BETA_URL = "http://adam.beta.instructure.com"
RECIPIENT = "2"
PORTAL_TOKEN = "1~R6LQJOPqzOWXQfLYDTnWXXC8rBnzlfcD9yatg004A7kQlkpEKSk8GtDGERhAJ86K"
PORTAL_AT_TOKEN = "1~4HqG8O8JN1f8H94IkhMYgjxD8LlEcNosQ0AJ7ET3Wh78X54fS6Be3mFHHnMiuiJs"
LOCAL_TOKEN = "1~KtP1voLOAsUkIgqum0qfMZl7N9PaQQhsI9vAhii0UgASIUDW40belLlk0Bhm8Mmi"
BETA_TOKEN = "1~gBl5tEyJ1jcCe8onAgO7rOhp8lo9fm2omVbYISciCa8BrKFJndmTqkUtNdWrJQoF"
PORTAL_URL = "54.243.66.130"
LOCAL_URL = "http://localhost:3000"
BETA_URL = "http://adam.beta.instructure.com"
RECIPIENT = "2"
SELECTION
ACCOUNT
@adam-phillipps
adam-phillipps / Creates users and conversations (WIP needs tokens)
Created May 23, 2013 04:48
This one includes creating a user and a converstation. it still needs to find a way to generate a unique token that complies with canvas and can be updated in the db for each user and entered back in the script. The tokens need to match the users that they were matched up with in the db....gonna be fun.
1 PORTAL_TOKEN = "1~R6LQJOPqzOWXQfLYDTnWXXC8rBnzlfcD9yatg004A7kQlkpEKSk8GtDGERhAJ86K"
2 PORTAL_AT_TOKEN = "1~4HqG8O8JN1f8H94IkhMYgjxD8LlEcNosQ0AJ7ET3Wh78X54fS6Be3mFHHnMiuiJs"
3 LOCAL_TOKEN = "1~KtP1voLOAsUkIgqum0qfMZl7N9PaQQhsI9vAhii0UgASIUDW40belLlk0Bhm8Mmi"
4 BETA_TOKEN = "1~gBl5tEyJ1jcCe8onAgO7rOhp8lo9fm2omVbYISciCa8BrKFJndmTqkUtNdWrJQoF"
5 PORTAL_URL = "54.243.66.130"
6 LOCAL_URL = "http://localhost:3000"
7 BETA_URL = "http://adam.beta.instructure.com"
8 RECIPIENT = "2"
9 @selection = ''
10 @account = ''
1 PORTAL_TOKEN = "1~R6LQJOPqzOWXQfLYDTnWXXC8rBnzlfcD9yatg004A7kQlkpEKSk8GtDGERhAJ86K"
2 PORTAL_AT_TOKEN = "1~4HqG8O8JN1f8H94IkhMYgjxD8LlEcNosQ0AJ7ET3Wh78X54fS6Be3mFHHnMiuiJs"
3 LOCAL_TOKEN = "1~KtP1voLOAsUkIgqum0qfMZl7N9PaQQhsI9vAhii0UgASIUDW40belLlk0Bhm8Mmi"
4 BETA_TOKEN = "1~gBl5tEyJ1jcCe8onAgO7rOhp8lo9fm2omVbYISciCa8BrKFJndmTqkUtNdWrJQoF"
5 PORTAL_URL = "54.243.66.130"
6 LOCAL_URL = "http://localhost:3000"
7 BETA_URL = "http://adam.beta.instructure.com"
8 RECIPIENT = "2"
9 @selection = ''
10 @account = ''
@adam-phillipps
adam-phillipps / gist:5641340
Created May 24, 2013 04:54
Stops working when I enter in the token. adam-2:scripts adam$ ruby create_conversations_attempt2.rb WARNING: AT THIS TIME, NO PRODUCTION TESTING MAY BE DONE DUE TO SECURITY RISKS UNLESS YOU SUPPLY YOUR OWN TOKEN. What user (token) will you be sending the conversation with? Portal Admin, Portal Teacher, Local Admin, Beta Admin, Other? PORTAL Tell…
PORTAL_TOKEN = "1~R6LQJOPqzOWXQfLYDTnWXXC8rBnzlfcD9yatg004A7kQlkpEKSk8GtDGERhAJ86K"
PORTAL_AT_TOKEN = "1~4HqG8O8JN1f8H94IkhMYgjxD8LlEcNosQ0AJ7ET3Wh78X54fS6Be3mFHHnMiuiJs"
LOCAL_TOKEN = "1~KtP1voLOAsUkIgqum0qfMZl7N9PaQQhsI9vAhii0UgASIUDW40belLlk0Bhm8Mmi"
BETA_TOKEN = "1~gBl5tEyJ1jcCe8onAgO7rOhp8lo9fm2omVbYISciCa8BrKFJndmTqkUtNdWrJQoF"
PORTAL_URL = "54.243.66.130"
LOCAL_URL = "http://localhost:3000"
BETA_URL = "http://adam.beta.instructure.com"
RECIPIENT = "2"
@number = 0
@account = ''
@adam-phillipps
adam-phillipps / create_conversations v3
Created May 24, 2013 23:43
cleaned up but probably not going to work in the end because of the dang tokens...
tokens = {
'PORTAL ADMIN' => "1~R6LQJOPqzOWXQfLYDTnWXXC8rBnzlfcD9yatg004A7kQlkpEKSk8GtDGERhAJ86K"
'PORTAL TEACHER' => "1~4HqG8O8JN1f8H94IkhMYgjxD8LlEcNosQ0AJ7ET3Wh78X54fS6Be3mFHHnMiuiJs"
'PORTAL TOKEN' => "1~R6LQJOPqzOWXQfLYDTnWXXC8rBnzlfcD9yatg004A7kQlkpEKSk8GtDGERhAJ86K"
'PORTAL AT TOKEN' => "1~4HqG8O8JN1f8H94IkhMYgjxD8LlEcNosQ0AJ7ET3Wh78X54fS6Be3mFHHnMiuiJs"
'LOCAL TOKEN' => "1~KtP1voLOAsUkIgqum0qfMZl7N9PaQQhsI9vAhii0UgASIUDW40belLlk0Bhm8Mmi"
'BETA TOKEN' => "1~gBl5tEyJ1jcCe8onAgO7rOhp8lo9fm2omVbYISciCa8BrKFJndmTqkUtNdWrJQoF"
}
urls = {
@token = tokens[@token] if tokens[@token]
if tokens[@token] (if there's a matching token in hash, use it)
@token = tokens[@token] (if not, leave it alone)
end
tokens = {
/*******************************************************
* Name: Adam Phillipps
* Assignment: A01
*******************************************************/
import java.util.Scanner;
public class A01
{
public static void main(String[] args)
@adam-phillipps
adam-phillipps / gist:5750104
Created June 10, 2013 16:26
script to register users
Dir.chdir("~/code/scripts")
2 puts script/runner
3 puts register.rb
4 end
5
6
7 def register_users()
8 (81..300).each.do |i|
9 User.find_by_id(i).update_attributes({workflow_state => 'active'})
10 puts "Progress at: #{i}"
@adam-phillipps
adam-phillipps / gist:5760891
Created June 11, 2013 21:31
v2 create conversations/users. need token
1 tokens = {
2 'PORTAL ADMIN' => "1~R6LQJOPqzOWXQfLYDTnWXXC8rBnzlfcD9yatg004A7kQlkpEKSk8GtDGERhAJ86K"
3 'PORTAL TEACHER' => "1~4HqG8O8JN1f8H94IkhMYgjxD8LlEcNosQ0AJ7ET3Wh78X54fS6Be3mFHHnMiuiJs"
4 'PORTAL TOKEN' => "1~R6LQJOPqzOWXQfLYDTnWXXC8rBnzlfcD9yatg004A7kQlkpEKSk8GtDGERhAJ86K"
5 'PORTAL AT TOKEN' => "1~4HqG8O8JN1f8H94IkhMYgjxD8LlEcNosQ0AJ7ET3Wh78X54fS6Be3mFHHnMiuiJs"
6 'LOCAL TOKEN' => "1~KtP1voLOAsUkIgqum0qfMZl7N9PaQQhsI9vAhii0UgASIUDW40belLlk0Bhm8Mmi"
7 'BETA TOKEN' => "1~gBl5tEyJ1jcCe8onAgO7rOhp8lo9fm2omVbYISciCa8BrKFJndmTqkUtNdWrJQoF"
8 }
9
10 urls = {