Skip to content

Instantly share code, notes, and snippets.

View melissapott's full-sized avatar

Melissa Pott melissapott

View GitHub Profile
@melissapott
melissapott / slack.php
Created April 2, 2019 22:19 — forked from stefanzweifel/slack.php
Slack.com Webhook Integration (PHP) - Simple snippet which tells you, how to build your payload array.
<?php
//Options
$token = 'YOUR_TOKEN_HERE';
$domain = 'YOUR_SLACK_DOMAIN_GOES_HERE';
$channel = '#general';
$bot_name = 'Webhook';
$icon = ':alien:';
$message = 'Your message';
@melissapott
melissapott / force-download.php
Created November 9, 2018 18:35 — forked from ericakfranz/force-download.php
Force Downloads by setting the correct mime type.
/**
* Force Download
*
* Generates headers that force a download to happen
* Example usage:
* force_download( 'screenshot.png', './images/screenshot.png' );
*
* @access public
* @param string $filename
* @param string $data