Skip to content

Instantly share code, notes, and snippets.

View Korko's full-sized avatar

Jérémy Lemesle Korko

View GitHub Profile
@Korko
Korko / cleanup.php
Last active August 29, 2015 13:57
Upload an img and store it locally
#!/usr/bin/php
<?php
$dir = 'tmp/';
$files = scandir($dir);
$delay = time() - 2*60;
foreach($files as $file) {
if(strpos($file, '.png') !== false && filemtime($dir.$file) <= $delay) {
echo $dir.$file."\n";
@Korko
Korko / gist:5fbc46ce52e3d5f802a0
Last active August 29, 2015 14:03
[Minecraft][Command Blocks][1.7] HydraZombie # Kill one and two will spawn
# CommandBlock order : West, East, Down, Up, North, South
# Only call once
/scoreboard objectives add Hydra dummy
/scoreboard objectives add BabyHydra dummy
# Summon a persistent (never despawning) Zombie
/summon Zombie ~ ~ ~ {CustomName:"HydraZombie",CustomNameVisible:1,Equipment:[{},{},{id:minecraft:carrot,Count:1,tag:{display:{Name:"HydraSource1"}}},{id:minecraft:potato,Count:1,tag:{display:{Name:"HydraSource2"}}},{id:iron_helmet}],DropChances:[0.0f,0.0f,2.0f,2.0f,0.0f],PersistenceRequired:1}
# Around a fast clock (20t/s)
@Korko
Korko / gist:2fa1772cc20f504c92a5
Last active August 29, 2015 14:05
[Minecraft][Command Blocks][1.8][WIP] Diving secretly # While he's diving, mobs around ignore the player
# CommandBlock order : West, East, Down, Up, North, South
# Only call once
/scoreboard objectives add Diving stat.diveOneCm
/scoreboard objectives add Stupid dummy
# Around a fast clock (20t/s)
# /fill ~ ~-1 ~ ~ ~-1 ~-1 redstone_block
# /fill ~ ~1 ~ ~ ~1 ~-1 stone
@Korko
Korko / gist:22b6ee2c91fb7d969f92
Last active August 29, 2015 14:05
[Minecraft][Command Blocks][1.8] Real invisibility # While he's invisible, mobs around ignore the player
# CommandBlock order : West, East, Down, Up, North, South
# Only call once
/scoreboard objectives add Invisible dummy
/scoreboard objectives add Stupid dummy
# Around a fast clock (20t/s)
# /fill ~ ~-1 ~ ~ ~-1 ~-1 redstone_block
# /fill ~ ~1 ~ ~ ~1 ~-1 stone
@Korko
Korko / gist:1c15413cb8f594c0357c
Last active August 29, 2015 14:05
[Minecraft][Command Blocks][1.8] LifeSteal enchantment # Using a sword with this enchantment will give you some heal back
# CommandBlock order : West, East, Down, Up, North, South
# /give @p minecraft:diamond_sword 1 0 {display:{Name:"LifeStealer"},ench:[{id:7,lvl:1}],HideFlags:1}
# /replaceitem entity @p slot.hotbar.0 minecraft:diamond_sword 1 0 {display:{Name:"LifeStealer"},ench:[{id:7,lvl:1}]}
# Only call once
/scoreboard objectives add LifeSteal dummy
/scoreboard objectives add DamageDealt stat.damageDealt
/scoreboard objectives add DamageAdded dummy
@Korko
Korko / gist:d3d87e9edaa7d442c920
Last active August 29, 2015 14:05
[Minecraft][Command Blocks][1.8][BLOCKED] Mobs Lure # Specific Snowball that after a short delay will lure mobs
# CommandBlock order : West, East, Down, Up, North, South
# /give @p snowball 1 0 {display:{Name:"Lure"}}
# Only call once
/scoreboard objectives add LureDelay dummy
/scoreboard objectives add OnGround dummy
# Around a fast clock (20t/s)
# /fill ~ ~-1 ~ ~ ~-1 ~-1 redstone_block
@Korko
Korko / gist:13106fa61ede051fc486
Last active August 29, 2015 14:05
[Minecraft][Command Blocks][WIP] Torch Bomb - Launch a projectile that will explode into torches
# CommandBlock order : West, East, Down, Up, North, South
# Enchantment TorchBomber ID 101
# /give @p minecraft:bow 1 0 {display:{Lore:["TorchBomber"]},ench:[{id:101,lvl:1}]}
# /give @p minecraft:arrow 1
# Only call once
/scoreboard objectives add HandlingTorchBomber dummy
/scoreboard objectives add ArrowLifetime dummy
@Korko
Korko / gist:71eb2fa9bca5c5065083
Last active August 29, 2015 14:05
[Minecraft][Command Blocks][WIP] Medusa Helmet - When wearing this helmet, all mobs in sight will freeze (limited radius)
#TODO
@Korko
Korko / gist:bb792387667d7cfba300
Last active August 29, 2015 14:05
[Minecraft][Command Blocks][1.8] Freezing Boots # When walking with these, water becomes ice and lava becomes obsidian
# CommandBlock order : West, East, Down, Up, North, South
# /give @p minecraft:diamond_boots 1 0 {display:{Lore:["Icy Boots"]},ench:[{id:102,Level:1}]}
# Only call once
/scoreboard objectives add IceBooted dummy
# Around a fast clock (20t/s)
# /fill ~ ~-1 ~ ~ ~-1 ~-1 redstone_block
# /fill ~ ~1 ~ ~ ~1 ~-1 stone
@Korko
Korko / secretsanta.php
Last active November 18, 2015 15:18
SecretSanta form to select random friend to gift
<?php
if(isset($_POST['submit'])) {
handleForm();
}
else {
displayForm();
}
function displayForm() {