Skip to content

Instantly share code, notes, and snippets.

@acapps
acapps / cURL-zipwhip-support
Created October 21, 2014 17:34
Zipwhip Support Ticket.
POST /comment/send HTTP/1.1
Host: https://api.zipwhip.com
$curl https://api.zipwhip.com/comment/send \
-d [email protected] \
-d name=[Users name] \
-d topic=I am the subject field. \
-d comment=I am the body of the support request. \
-d portal=[Portal ID] \
@acapps
acapps / gist:4e609daa5bed01050c09
Created February 27, 2015 17:01
Sample-SMTP-Payload
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
From: "Desk" <[email protected]>
To: "Cell" <[email protected]>
Subject: "8ef1211f-d9f2-4c81-906f-7d27da5a32f8:309626613"
MIME-Version: 1.0
SGVsbG8gV29ybGQKCkhvdyBhcmUgeW91IHRvZGF5PwoKR29vZCBUaGFua3Mh
@acapps
acapps / basic_input_list.sh
Last active July 6, 2016 19:39
Simple BASH script to loop through an input list.
#! /bin/bash
input_list=`cat $1`
for i in $input_list
do
response=$(curl -s -X POST http://exampleurl.com/ -d parameter=$i)
echo $i::$response >> $1.log
done
@acapps
acapps / Main.java
Last active January 16, 2019 20:25
Sending an MMS via Zipwhip's API using Java.
import java.io.*;
import java.nio.file.Files;
import java.util.List;
public class Main {
public static void main(String[] args) {
String charset = "UTF-8";
File uploadFile1 = new File("/Users/alancapps/Desktop/test.jpg");

POST /user/signature/set Http/1.1

Host: https://api.zipwhip.com

Parameters:

session - Required for authentication.

signature - the desired signature.

POST /user/save Http/1.1

Host: https://api.zipwhip.com

Parameters:

session - Required for authentication.

firstName - User's first name.

@acapps
acapps / PHP-All Keys Exist in Array.
Created June 23, 2016 22:36
All keys exist in array.
//The values in this arrays contains the names of the indexes (keys) that should exist in the data array
$required = array('key1', 'key2', 'key3' );
$data = array(
'key1' => 10,
'key2' => 20,
'key3' => 30,
'key4' => 40
);
@acapps
acapps / exists.sql
Created September 14, 2016 22:24
SQL, at least one result exists.
SELECT EXISTS(SELECT 1 FROM table_name WHERE id = 1);
If it id exists then it will return 1 otherwise it will return 0.
@acapps
acapps / Filter_JS_IMG_CSS
Created September 20, 2016 05:29
Query Access Logs, but ignore the noise, css, img, js.
cat access.log.2016-09-18 | grep '{search_term}' | grep -v '/css' | grep -v '/js' | grep -v '/img'
@acapps
acapps / stopLogic.go
Last active November 1, 2016 18:54
Example implementation of Zipwhip's Stop Handling. One file, as it is meant to run on the Go Playground
package main
import (
"fmt"
"strings"
)
func main() {
testStop()