Skip to content

Instantly share code, notes, and snippets.

View js
.done(function(data) {
// Whatever data is
if(data.redirect !== undefined) {
window.location = data.redirect;
} else if(data.error !== undefined) {
_error
.text(data.error)
.show();
}
})
View The event.setCancel() is not preventing the shovel from bieng damaged.
@EventHandler
public void PlayerInteract(BlockDamageEvent event) {
Player player = event.getPlayer();
boolean enabledShovel = plugin.getShovelState(player);
Block block = event.getBlock();
ItemStack itemInHand = event.getItemInHand();
if(enabledShovel == true && itemInHand.getType() == org.bukkit.Material.GOLD_SPADE) {
if(block.getType() == org.bukkit.Material.SNOW || block.getType() == org.bukkit.Material.SNOW_BLOCK) {
event.setInstaBreak(true);
@Quirkylee
Quirkylee / errr!
Created Apr 19, 2011
anything wrong with the code? else is not showing.
View errr!
<?php
if($_GET['a'] = "addalbum") {
} elseif($_GET['a'] = "manalbum") {
} elseif($_GET['a'] = "editalbum") {
} else {
echo "e";
$gallery = $db->query("SELECT * FROM albums ORDER BY name ASC");
echo "<table>";
while($row = $gallery->fetch_assoc()) {
echo "<tr><td><a href=\"admin.php?p=gallery&a=editalbum&i=".$row['id']."\">Edit Details</a></td>";
@Quirkylee
Quirkylee / here is the code
Created Apr 16, 2011
I want to place the watermark at the bottom of the original image and resize the watermark so it fits in the original image
View here is the code
<?php
require("inc/core.php");
$row = $db->query("SELECT type,original FROM photos WHERE id =".$_GET['i']);
$row = $row->fetch_assoc();
$loc = $row['original'];
if($type == "image/jpeg") {
echo $row['original'];