Last active
February 6, 2017 16:31
-
-
Save John2496/a2823bd1c04e5d83fa6c to your computer and use it in GitHub Desktop.
Project managers don't want you to know about this one simple tip...
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
<?php | |
// simple technique to remove bugs from your code | |
// example buggy code | |
$your_code = "<html><Oh man>i hope i don't have any American cockroaches in my code</Oh man></html>"; | |
$list_of_bugs = array('American cockroach', 'Ants', 'Aphids', 'Aphids', 'Asian paper wasp', | |
'Asian paper wasp nest', 'Assassin bug', 'Australian bag moth', 'Australian bag moth pupa', | |
'Avondale spider', 'Backswimmer', 'Bamboo moth', 'Banana moth', 'Banana moth pupa', | |
'Banded tunnelweb spider', 'Bed bug', 'Black cockroach', 'Black tunnelweb spider', | |
'Black-headed jumping spider', 'Blister caused by Lax beetle', 'Blowflies', 'Blue Moon butterfly', | |
'Booklice', 'Bronze beetle', 'Bronze beetle damage', 'Brown garden snail', 'Brown house moth', | |
'Bumble bees', 'Burnished brass moth', 'Burnt Pine longhorn', 'Cabbage tree caterpillar', | |
'Cabbage tree leaf damage', 'Cabbage tree moth', 'Cabbage white caterpillar', 'Carpet beetle', | |
'Carpet beetle larva', 'Caterpillar of Bamboo moth', 'Caterpillar of Cinnabar Moth', | |
'Caterpillar of North Island Lichen Moth', 'Cattle tick', 'Cave Weta', 'Chorus cicada', 'Cicada damage', | |
'Cicada eggs', 'Cicada nymph', 'Cinnabar Moth', 'Click beetle', 'Clothes moth', 'Codling moth', | |
'Common bag moth', 'Common bag moth larva', 'Common Blue Butterfly', 'Copper Butterfly', 'Crane fly', | |
'Cricket', 'Daddy longlegs spider', 'Damselfly', 'Desjardin\'s beetle', 'Dew-drop spider', 'Dried fruit moth', | |
'Dried fruit moth caterpillar', 'Drugstore beetle', 'Earwig', 'Eucalypt longhorn beetle', 'European earwig', | |
'False katipo spider', 'Field Grasshopper', 'Flatworms', 'Flax looper caterpillar adult', 'Flax looper damage', | |
'Flax notch caterpillar, adult', 'Flax notcher damage', 'Fleas', 'Flower longhorn beetle', 'Garden orbweb spider', | |
'Garden slug', 'Garden soldier fly', 'Garden soldier fly larva', 'German cockroach', 'German wasp', | |
'German wasps\' nest', 'Giant dragonfly', 'Giant ichneumonid', 'Giraffe weevil', 'Gisborne cockroach', | |
'Golden orbweb spider', 'Golden orbweb spider eggsac', 'Grass grub', 'Grass moths', 'Green looper caterpillar', | |
'Green planthopper', 'Green Spangled moth', 'Green stonefly', 'Green vegetable bug', 'Green vegetable bug', | |
'Grey house spider', 'Guava Moth', 'Gum emperor eggs', 'Gum emperor larva', 'Gum emperor moth', | |
'Gum emperor moth pupa', 'Gum leaf skeletoniser', 'Gum leaf skeletoniser caterpillar', 'Gum leaf skeletoniser eggs', | |
'Harvestman', 'Head louse', 'Hibiscus beetle', 'Hide Beetle', 'Hide beetle larva', 'Honey bee', | |
'Hoppers or Amphipods', 'Horizontal orbweb spider', 'House borer', 'House centipede', 'House fly', 'House fly larvae', | |
'Huhu beetle', 'Huhu beetle pupa', 'Huhu grub', 'Indian meal moth', 'Indian meal moth larva', 'Katipo spider', | |
'Katydid', 'Kawakawa Looper', 'Kawakawa looper damage', 'Kowhai moth', 'Kowhai moth caterpillar', 'Kumara moth', | |
'Kumara moth caterpillar', 'Kumara moth pupa', 'Ladybird', 'Ladybird larva', 'Ladybird larva with wax excretions', | |
'Large centipede', 'Large Sand Scarab larva', 'Large white butterfly caterpillar', 'Leafroller caterpillar', 'Leech', | |
'Lemon tree borer', 'Lemon tree borer adult', 'Lemon tree borer parasite', 'Lesser Housefly', 'Lesser Wanderer', | |
'Lesser Wanderer Caterpillar', 'Light Brown Apple Moth, leafroller caterpillar', 'Locust', 'Longhorn beetles', 'Maggots', | |
'Magpie moth', 'Mason wasp', 'Mason wasp nest', 'Mealybug', 'Mealybug Ladybird', 'Mercury Island tusked weta', | |
'Metallic green rove beetle', 'Millipedes', 'Mite damage', 'Mites', 'Mole Cricket', 'Monarch butterfly', | |
'Monarch butterfly chrysalis', 'Monarch caterpillar', 'Mosquito', 'Mosquito larvae', 'Mosquito pupa', | |
'Native bush cockroach', 'New Zealand Grasshopper', 'New Zealand praying mantis', 'New Zealand praying mantis eggcase', | |
'North Island Lichen Moth', 'Nurseryweb spider', 'Orange Ichneumonid wasp', 'Outhouse fly', 'Owl moth caterpillar', | |
'Owl moth or peacock moth', 'Painted apple moth', 'Painted apple moth caterpillar', 'Painted lady butterfly', | |
'Passionvine hopper', 'Passionvine hopper', 'Passionvine hopper egg scars in twig', 'Pasture wireworm', 'Peripatus', | |
'Plume moths', 'Pseudoscorpion', 'Psyllids', 'Pupa of Bamboo moth', 'Puriri moth', 'Puriri moth caterpillar', | |
'Puriri moth damage', 'Rattailed maggot', 'Red admiral', 'Red admiral caterpillar', 'Red Admiral Pupa', 'Rice weevil', | |
'Rose scale, an example of an armoured scale', 'Sandflies', 'Sandfly bites', 'Scarab beetles', 'Sheetweb spider', | |
'Silver Y moth', 'Silverfish', 'Slater spider', 'Slaters', 'Small green long&ndash;legged fly', 'Small land snails', | |
'Soft brown scale, an example of a soft scale', 'Solitary wasp', 'South African praying mantis', | |
'South African praying mantis eggcase', 'Soybean looper', 'Spider hunting wasps', 'Spotted lax beetle', 'Springtails', | |
'Square ended crab spider', 'Stick insects', 'Striped lax beetle.', 'Swan plant seed bug', 'Swan plant seed bug nymph', | |
'Swift ground spider', 'Tasmanian paper wasp', 'Termite damage', 'Termites', 'Termites', 'Threelined hoverfly', 'Thrips', | |
'Tiger beetle', 'Tomato fruitworm', 'Tomato fruitworm moth', 'Tortoise beetle', 'Tree weta', | |
'Tropical army worm egg mass', 'Tropical armyworm', 'Tropical armyworm moth', 'Twospined spider', | |
'Twospined spider egg sac', 'Vagrant spider', 'Variegated Longhorn', 'Vegetable weevil', 'Veined slug', 'Vinegar flies', | |
'Wasp workings', 'Water boatman', 'White butterfly', 'White spotted tussock moth', 'White spotted tussock moth caterpillar', | |
'White spotted tussock moth eggs', 'Whitefly', 'Whitespotted Ichneumonid', 'Whitetailed spider', 'Winged weta', 'Wolf spider', | |
'Wood wasp', 'Wool Carder Bee', 'Woolly bear caterpillar', 'Worms', 'Yellow Admiral', 'Yellow Admiral Caterpillar', | |
'Yellow cellar slug'); | |
// bugz exterminated | |
// TODO: FIX UNCONFIRMED BUG - http://www.reddit.com/r/shittyprogramming/comments/2bqcse/one_simple_technique_to_remove_bugs_from_your_code/cj88u01 | |
$clean_code = str_replace($list_of_bugs, '', $code); | |
echo $clean_code; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lol