Skip to content

Instantly share code, notes, and snippets.

View designly1's full-sized avatar

Jay Simons designly1

View GitHub Profile
@designly1
designly1 / Helper.class.php
Last active May 21, 2023 17:27
A static site generator (SSG) and templating engine built in PHP.
<?php
class Helper
{
static public function buildPostData($post)
{
// get css files
$css = "";
foreach (BLOG_CSS_FILES as $file) {
$css .= "<link rel=\"stylesheet\" href=\"$file\" />\n";
import { Configuration, OpenAIApi } from "openai";
import NextCors from 'nextjs-cors';
const configuration = new Configuration({
apiKey: process.env.NEXT_PUBLIC_OPENAI_KEY,
});
const openai = new OpenAIApi(configuration);
export default async function handler(req, res) {
<?php
// Required if your environment does not handle autoloading
require __DIR__ . '/vendor/autoload.php';
// Use the REST API Client to make requests to the Twilio REST API
use Twilio\Rest\Client;
// Your Account SID and Auth Token from twilio.com/console
$sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$token = 'your_auth_token';
@designly1
designly1 / twilio-sms.js
Created May 10, 2022 22:48
Node.JS Twilio SMS Example
/* Node.JS */
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; // Your Account SID from www.twilio.com/console
const authToken = 'your_auth_token'; // Your Auth Token from www.twilio.com/console
const twilio = require('twilio');
const client = new twilio(accountSid, authToken);
client.messages
.create({
messagingServiceSid: "YOUR_MESSAGING_SERVICE_ID",
@designly1
designly1 / jQuery.touch.js
Created April 29, 2019 20:02
jQuery Touch Demo
$.fn.touch = function (callback) {
$.touchMove = false;
$.touch = false;
$.touchAction = "";
$(this).on("click", function (e) {
if (!$.touch) {
$.touchAction = 'click';
let callbackReal = callback.bind(this);
callbackReal(this, e);
} else {