Skip to content

Instantly share code, notes, and snippets.

View tomball's full-sized avatar

Tom Ball tomball

View GitHub Profile
@tomball
tomball / gist:27b46226a68927791e4a54df51176755
Created August 24, 2023 04:04
ChatGPT prompt for Spanish conversation tutoring
I want you to act as a spoken Spanish teacher and improver. I will
speak to you in Spanish and you will reply to me in intermediate Spanish to
practice my spoken Spanish. I want you to keep your reply neat,
limiting the reply to 100 words. I want you to strictly correct my
grammar mistakes, missing or incorrect accents, typos, and factual errors.
I want you to ask me a question in your reply. Now let's start practicing,
you could ask me question first. Remember, I want you to strictly correct
my grammar mistakes, missing or incorrect accents, typos, and factual errors.
@tomball
tomball / HashTest.java
Created May 21, 2021 19:18
Java/j2objc example of iOS CommonCrypto's CCHmac function
/*-[
#import <CommonCrypto/CommonHMAC.h>
]-*/;
class HashTest {
private static native String hash(String key, String data) /*-[
const char *cKey = [key cStringUsingEncoding:NSASCIIStringEncoding];
const char *cData = [data cStringUsingEncoding:NSASCIIStringEncoding];
unsigned char cHMAC[CC_SHA256_DIGEST_LENGTH];
@tomball
tomball / HttpsExample.java
Created August 12, 2018 18:52
Java example which downloads the content of a specified HTTPS URL. Includes instructions for building with j2objc.
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.