This file contains hidden or 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
#!/bin/bash | |
echo "" | |
echo "----------" | |
echo "This bash script recursively goes through every PNG file in a given folder" | |
echo "and removes its alpha channel. This is useful for preparing PNG files for" | |
echo "uploading to Apple's iOS App Store." | |
echo "" | |
echo "You'll know you might need to use this script if you see this error coming" | |
echo "from Apple when you try to upload the images:" |
This file contains hidden or 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
/* | |
* This function replaces the token string with the replacement string, but maintains | |
* the original whitespace indentation the token had within the template. | |
* | |
* For example if your template has: | |
* | |
* <div> | |
* {% TOKEN %} | |
* </div> | |
* |
This file contains hidden or 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
#!/bin/sh | |
IMAGE_STRING="http://localhost/git/imageGenerator.php?w=200&h=200" | |
OUTPUT_EXTENSION="png" | |
INDEX=0 | |
NUM_IMAGES=30 | |
while [ "${INDEX}" != "${NUM_IMAGES}" ] | |
do |
This file contains hidden or 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 | |
// | |
// Creates a JPG of the given size and with the given text in | |
// the center. | |
// | |
// parameters | |
// TODO: Is this secure enough? | |
$text = $_REQUEST['t']; |
This file contains hidden or 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
import java.awt.image.BufferedImage; | |
import java.awt.image.DataBufferByte; | |
import java.io.File; | |
import java.io.IOException; | |
import javax.imageio.ImageIO; | |
public class ImageDiff { | |
private static BufferedImage expectedImage; |
This file contains hidden or 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
#!/bin/sh | |
# parse the test name from the path to the input file (/path/to/myTest.input => _path_to_myTest.input) | |
TEST_NAME=${1} | |
TEST_NAME=${TEST_NAME//A/B} | |
#TEST_NAME=${TEST_NAME/A/B} -> replace first occurrence | |
echo ${TEST_NAME} |
This file contains hidden or 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
#!/bin/sh | |
# Usage: ./getFileSize.sh myFile.exe | |
# Outputs file size of the given file | |
FILE=${1} | |
DIRTY=`wc -c ${FILE}` |
This file contains hidden or 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
#!/bin/sh | |
# parse the test name from the path to the input file (/path/to/myTest.input => myTest) | |
TEST_NAME=${1} | |
TEST_NAME=${TEST_NAME%.input*} | |
TEST_NAME=${TEST_NAME##*/} | |
echo ${TEST_NAME} |