Skip to content

Instantly share code, notes, and snippets.

View cr0wst's full-sized avatar

Steve Crow cr0wst

View GitHub Profile
@cr0wst
cr0wst / MessageStatus.java
Created January 21, 2018 01:04
Nexmo SMS XML -> JSON
package com.nexmo.client.sms;
import java.util.HashMap;
import java.util.Map;
public enum MessageStatus {
STATUS_OK(0),
STATUS_THROTTLED(1),
STATUS_MISSING_PARAMS(2),
STATUS_INVALID_PARAMS(3),
@cr0wst
cr0wst / Sample.php
Created February 23, 2018 16:49
Inner Builder Example
<?php
namespace Smcrow\Sample;
class Sample
{
protected $id;
protected $comments;
public static function builder()
@cr0wst
cr0wst / Person.php
Created February 24, 2018 19:44
Example of Person w/ Builder.
<?php
class Person {
protected $firstName;
protected $middleName;
protected $lastName;
protected $age;
protected $gender;
protected $height;
@cr0wst
cr0wst / AllExceptCurrent.java
Created June 17, 2018 14:33
Java Stream Example: Iterate through list and display all others for each element.
package net.smcrow.sandbox.streams;
import java.util.List;
public class AllExceptCurrent {
private static final List<String> FRIENDS = List.of("Sarah", "John", "Megan", "Joseph");
public static void main(String... args) {
System.out.println("Without Streams");
withoutStreams();
@cr0wst
cr0wst / MultiplyAllByFive.java
Last active June 17, 2018 15:06
Java Stream Example: Multiple all elements by 5
package net.smcrow.sandbox.streams;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class MultiplyAllByFive {
private static final List<Integer> NUMBERS = List.of(1, 2, 3, 4, 5);
@cr0wst
cr0wst / CreateListsOfProperties.java
Created June 17, 2018 15:21
Java Stream Example: Create lists of properties of list of objects.
package net.smcrow.sandbox.streams;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class CreateListsOfProperties {
private static final List<Person> PEOPLE = List.of(new Person("Sarah", 29),
new Person("John", 16),

Keybase proof

I hereby claim:

  • I am cr0wst on github.
  • I am cr0wst (https://keybase.io/cr0wst) on keybase.
  • I have a public key ASAoUK7EBrBF05fCxCzsxRJjHxx_jpeMHD5disw3sTt_rwo

To claim this, I am signing this object:

@cr0wst
cr0wst / verify.java
Created February 8, 2019 15:00
Verification Process
// Send CODE to user
VerifyResponse response = client.getVerifyClient().verify(RECIPIENT_NUMBER, BRAND);
// Check CODE from user
CheckResponse checkResponse = client.getVerifyClient().check(REQUEST_ID, CODE);
if (checkResponse.getStatus() == VerifyStatus.OK) {
// Successful verification!
}
@cr0wst
cr0wst / SENDSMS.cbl
Created March 6, 2019 18:48
Send SMS Using Nexmo CLI triggered via GnuCOBOL
******************************************************************
* Author: Steve Crow (steve.crow@nexmo.com)
* Date: March 6 2019
* Purpose: Send an SMS using COBOL to trigger the Nexmo CLI
* Tectonics: cobc
* First install the Nexmo CLI (curl example coming shortly)
******************************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. SENDSMS.
DATA DIVISION.
@cr0wst
cr0wst / SENDSMSC.cbl
Last active June 30, 2020 20:35
Send SMS from COBOL by executing curl
******************************************************************
* Author: Steve Crow (steve.crow@nexmo.com)
* Date: March 6 2019
* Purpose: Send an SMS using COBOL and curl via command line.
* Tectonics: cobc
******************************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. SENDSMS.
DATA DIVISION.
WORKING-STORAGE SECTION.