Skip to content

Instantly share code, notes, and snippets.

View robmorgan's full-sized avatar
🇦🇺
Aussie! Aussie! Aussie!

Rob Morgan robmorgan

🇦🇺
Aussie! Aussie! Aussie!
View GitHub Profile
@robmorgan
robmorgan / .gitconfig
Created December 4, 2013 08:24 — forked from gotar/.gitconfig
[user]
name = Oskar Szrajer
email = oskarszrajer@gmail.com
[alias]
br = branch
co = checkout
ci = commit
df = diff
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
<?php
/**
* Creates a thumbnail for any type of pre-existing image. Always saves as PNG image
* Works properly with GIF transparency and PNG Alpha Transparency.
* If Image is less than max_width and max_height it will stay at the size of the image.
*
* @param string - The location of the pre-existing image.
* @param string - The location to save the thumbnail, including filename and extension.
<?php
// need a true/false return if a needle is found.
$haystack = "this is the haystack/string full of goodness needle 1 needle 2"; // haystack
$needles = array("needle 1", "needle 2", "needle 3"); // needles
foreach ($needles as $key => $val) {
if (strpos($haystack, $val)) {
// do something
echo 'found match';