Skip to content

Instantly share code, notes, and snippets.

@Quirkylee
Quirkylee / js
Created December 2, 2018 00:36
try this
.done(function(data) {
// Whatever data is
if(data.redirect !== undefined) {
window.location = data.redirect;
} else if(data.error !== undefined) {
_error
.text(data.error)
.show();
}
})
@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 April 19, 2011 01:26
anything wrong with the code? else is not showing.
<?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 April 16, 2011 13:02
I want to place the watermark at the bottom of the original image and resize the watermark so it fits in the original image
<?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'];