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
class UsersController < Clearance::UsersController | |
# Override and add in a check for invitation code | |
def create | |
@user = User.new params[:user] | |
invite_code = params[:invite_code] | |
@invite = Invite.find_redeemable(invite_code) | |
# Invite code is present, there is an associated invite, and it is the user's invite | |
if invite_code && @invite && @invite.email == @user.email |
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
load($SCRIPT_DIR + "/../drone.js"); | |
var arr = [{i:1,b:'35:1'},{i:5,b:'35:5'},{i:3,b:'35:3'},{i:2,b:'35:2'},{i:4,b:'35:4'},{i:7,b:'35:7'},{i:8,b:'35:8'}, | |
{i:6,b:'35:6'},{i:0,b:35},{i:14,b:'35:14'},{i:13,b:'35:13'},{i:12,b:'35:12'},{i:10,b:'35:10'},{i:9,b:'35:9'},{i:11,b:'35:11'}]; | |
var render = function(a,d){ | |
d.up(a.length); | |
for(var k =0;k< a.length;k++){ | |
d.box(a[k].b).down(); | |
} |
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 hanoi = function(n, source, by, dest){ | |
if(n == 0) return; | |
// Move all the disks but the bottom disk (n – 1 disks) from the left pole to the middle pole. | |
hanoi(n-1,source,dest,by); | |
// Move the bottom disk to the right-most pole. | |
print("Move " + n + " from " + source + " to " + dest); | |
// Move all the disks from the middle pole (n – 1 disks) to the right-most pole. | |
hanoi(n-1,by,source,dest); | |
} |
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
load(__folder + "drone.js"); | |
Drone.extend("toh",function(dc){ | |
var d = this; | |
var tf = function(dc){ | |
var ta = []; | |
var tb = []; | |
var tc = []; | |
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
Python Mistakes | |
=============== | |
* It's not Ruby. |
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
load(__folder + "../core/scriptcraft.js"); | |
/* | |
definition | |
*/ | |
var simple = simple || plugin("simple",{ | |
setString: function(str){ | |
this.store.str = str; | |
}, | |
getString: function(){ |
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 bot = bot || plugin("bot", | |
{ | |
/* helper methods for a player's bot */ | |
get_bot: function(player){ | |
return this.store.players[player.name]; | |
}, | |
set_bot: function(player,bot,inventory){ | |
this.store.players[player.name] = {bot:bot,inventory:inventory}; | |
}, | |
/* |
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
/* | |
Usage: | |
/jsp summon | |
/jsp dismiss | |
/jsp come | |
/jsp stay | |
/jsp pack | |
*/ | |
load(__folder + "../core/scriptcraft.js"); |
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
spawn:function(){ | |
var player = getPlayerObject(); | |
var world = player.getWorld(); | |
// create a villager | |
var quest_npc = world.spawnCreature(player.getLocation().add(1,0,0), org.bukkit.entity.EntityType.VILLAGER); | |
quest_npc.setProfession(org.bukkit.entity.Villager.Profession.PRIEST); | |
quest.store.npcs[quest_npc.getUniqueId()] = quest_npc; | |
// listen for interaction events |
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
initialize_quest:function(player_name){ | |
quest.store.players[player_name] = { | |
current:-1, | |
accepted:false, | |
skeleton_counter:0, | |
steps:[{ | |
step:1, | |
text:"Hello, " + player_name + ". I have an unpleasant task if you desire some work." | |
}, | |
{ |
OlderNewer