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
#! /bin/bash | |
# Download Pow now at http://pow.cx/ | |
if [ \( "$2" != "-f" \) -a \( $# != 1 \) ] | |
then | |
echo "Usage: pow <appname> [-f]" | |
echo "<appname>.dev will be the development url." | |
exit 1 | |
else | |
_dir="$(pwd)" |
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
(function () { | |
if (typeof (CCDATA) === 'undefined' || typeof (CCDATA.page.user) === 'undefined' || typeof (CCDATA.page.user.id) === 'undefined') { | |
alert("Insufficient Data. Please try again on a valid Codecademy User page."); | |
return false; | |
} else { | |
$("body").append("<form action='/admin/forums/ban_user?user_identifier=" + CCDATA.page.user.id + "' class='button_to' method='post'><div><input name='_method' type='hidden' value='put' class='ui-inited'><input data-confirm='Are you sure you want to ban this user from the forums?' type='submit' id='BAN_FORM_SUBMIT' class='ui-inited'><input name='authenticity_token' type='hidden' value='" + csrf_token + "' class='ui-inited'></div></form>"); | |
$("#BAN_FORM_SUBMIT").click() | |
} | |
})(); |
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
(function(){ | |
if (typeof CCDATA.forum != "undefined" && window.location.pathname.split("/")[window.location.pathname.split("/").length - 2] === "forum_questions") { | |
id = window.location.pathname.split("/")[window.location.pathname.split("/").length - 1]; | |
$.ajax({ | |
url: "http://www.codecademy.com/forum_questions/" + id, | |
dataType: "json", | |
type: "GET", | |
beforeSend: function (e) { | |
e.setRequestHeader("X-Requested-With", "XMLHttpRequest"); | |
e.setRequestHeader("Accept", "application/json, text/javascript, */*; q=0.0") |
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
(function () { | |
$.ajax({ | |
url: "http://www.codecademy.com/groups/"+CCDATA.page.group._id+"/users/role", | |
dataType: "json", | |
type: "POST", | |
data: { | |
authentication_token: CCDATA.current_user.authentication_token, | |
user_id: CCDATA.current_user._id, | |
role: "member" | |
}, |
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
function(){ | |
if(typeof(CCDATA.page)!='undefined'&&typeof(CCDATA.page.user)!='undefined'&&typeof(CCDATA.page.user._id)!='undefined'){ | |
$.ajax({ | |
url:"http://www.codecademy.com/api/v1/users/"+CCDATA.page.user._id, | |
type:"GET", | |
dataType:"json", | |
beforeSend: function(xhr){ | |
xhr.setRequestHeader("X-CSRF-Token",csrf_token); | |
xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"); | |
xhr.setRequestHeader("Accept","application/json, text/javascript, */*; q=0.0"); |
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
(function () { | |
if (!(typeof CCDATA.page != "undefined" && typeof CCDATA.page.group != "undefined")) { | |
alert("You are not viewing a valid CC Group Page."); | |
return false | |
} | |
if (CCDATA.current_user._id !== CCDATA.page.group.roles.leader[0]) { | |
alert("You do not have permission to demote a user in this group."); | |
return false | |
} | |
var e = prompt("Enter the username or ID of the user you would like to demote from moderator to normal user. You can retrieve a user's ID by running 'CCDATA.page.user._id' in your javascript console on their profile page. \n \n Sometimes usernames will not work correctly and you must use the ID of the user."); |
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
(function () { | |
$.ajax({ | |
url: "http://www.codecademy.com/projects/", | |
dataType: "json", | |
type: "POST", | |
data: { | |
authentication_token: CCDATA.current_user.authentication_token, | |
codebit: { | |
name: prompt("Name your Codebit."), | |
files: [ |
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 'spec_helper' | |
describe 'Gifts' do | |
subject { page } | |
let(:user) { create :user, nickname: "akira" } | |
describe '#new' | |
before do | |
let!(:pull_request) { create :pull_request, user: user } | |
let!(:gift) { create(:gift, user: user, pull_request: pull_request) |
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
import json | |
import requests | |
d = json.loads(requests.get("https://api.github.com/repos/andrew/24pullrequests/contributors?access_token=REDACTED").text) | |
with open('output.txt', 'wb') as f: | |
for i in d: | |
e = json.loads(requests.get(i["url"]+"?access_token=REDACTED").text) | |
try: | |
print e["name"] |
This file has been truncated, but you can view the full file.
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
define("models/composer/file", ["require", "exports", "module", "backbone"], function (e, t, n) { | |
var r = e("backbone"); | |
n.exports = r.Model.extend({}) | |
}), define("collections/composer/files", ["require", "exports", "module", "collections/api/base", "models/composer/file"], function (e, t, n) { | |
var r = e("collections/api/base"), | |
i = e("models/composer/file"); | |
n.exports = r.extend({ | |
model: i, | |
namesepace: "files" | |
}) |
OlderNewer