Skip to content

Instantly share code, notes, and snippets.

<header id="header">
<div>
<div>
<a href="/" id="logo">
<img src="logo.svg">
</a>
<h1>Page Title</h1>
</div>
<div>
<a href="#header-dropdown">MENU</a>
public function fetchUrl_POST($url, $fields){
//open connection
$ch = curl_init();
foreach($fields as $key=>$value) {
$fields_string .= $key.'='.$value.'&';
}
rtrim($fields_string, '&');
//set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
public function getConvioAuth() {
$url = esc_attr( get_option('convio_api_url') ) . 'SRConsAPI';
$atts = array(
'method' => 'getSingleSignOnToken',
'api_key' => esc_attr( get_option('convio_api_key') ),
'login_name' => esc_attr( get_option('convio_api_auth_user') ),
'login_password' => esc_attr( get_option('convio_api_auth_pw') ),
'cons_id' => esc_attr( $_GET['cons_id'] ),
'v' => '1.0',
'response_format' => 'json'
<?php
$url = 'https://secure.globalproblems-globalsolutions.org/site/CRDonationAPI?luminateExtend=1.4.3&method=getDonationFormInfo&form_id=9020&api_key=unfkey&response_format=json&suppress_response_codes=true&v=1.0';
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "spider", // who am i
<?php
Header ("Content-type: image/jpeg");
function ImageTTFCenter($image, $text, $font, $size, $angle = 45) {
$xi = imagesx($image);
$yi = imagesy($image);
$box = imagettfbbox($size, $angle, $font, $text);
<?php
// Print two names on the picture, which accepted by query string parameters.
$n1 = $_GET['n1'];
$n2 = $_GET['n2'];
Header ("Content-type: image/jpeg");
$image = imageCreateFromPNG("someimage.png");
$color = ImageColorAllocate($image, 255, 255, 255);
<?php
//content type
header('Content-Type: image/png');
$font = 'znikomit-webfont.ttf';
$font_size = $_GET['s'];
$width = $_GET['w'];
$margin = 5;
$text = $_GET['t'];
<?php
/*
Plugin Name: Luminate API for Convio by SPARK
Plugin URL: http://sparkexperience.com
Description: Luminate Extend API for Convio by SPARK
Version: 0.1
Author: Spark Experience
Author URI: http://sparkexperience.com
*/
jQuery(document).ready(function(){
jQuery('.spark_sortable').each(function(){
jQuery(this).sortable({
update: function( event, ui ){
ui.item.parents('.spark_sortable').find('> div').each(function(){
jQuery(this).find('.update_order').val(jQuery(this).index());
})
var ui_item = ui.item;
ui.item.addClass('moved');
Array
(
[donationLevels] => Array
(
[0] => Array
(
[name] => Education
[image] =>
[description] =>
[order] => 0