Skip to content

Instantly share code, notes, and snippets.

@kezzico
kezzico / gist:355a3ebf880c1c5e58302acadd2ef916
Last active May 15, 2023 17:28
Firebase Dynamic Links + AppBoy
#import "Appboy-iOS-SDK/AppboyKit.h"
#import "ReactNativeConfig.h"
#import "SEGAppboyIntegrationFactory.h"
#import <RNFBDynamicLinks/RNFBDynamicLinksAppDelegateInterceptor.h>
static DeeplinkPusher *_shared = nil;
@implementation DeeplinkPusher
+ (DeeplinkPusher *) shared {
@kezzico
kezzico / linesCanIntersect.lua
Created May 18, 2023 18:40
test if 2 lines can intersect
-- Function to determine if 2 lines can intersect
-- The function `linesCanIntersect` accepts 2 lines as parameters.
-- l1p1,l1p2 and l2p1,l2p2
--
-- example usage:
-- if linesCanIntersect(l1p1, l1p2, l2p1, l2p2) then
--
-- end
# App Feature Mind Map
- Voice-guided Navigation
- Step-by-step audio instructions
- Real-time Location Tracking
- GPS technology for accurate directions
- Object Recognition
- Camera-based object identification
- Voice Commands
- Hands-free interaction with the app
@kezzico
kezzico / CODE_SAMPLE.js
Last active August 27, 2023 15:27
Algorithm for computing change due
// THANKS FOR READING
// HOPE YOU ENJOYED MY CODE
// LEE IRVINE [email protected]
process.stdin.resume();
process.stdin.setEncoding('utf8');
// RUNNER
let stdin = '';
import React, { useState } from 'react';
const MyComponent = (props) => {
// <MyComponent initialValue="foo" />
// add a state variable called 'value'
// grab value from initialValue attribute on <MyComponent>
const [value, setValue] = useState(props.initialValue);
# flaskapp.py
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route("/")
def index():
return "Hello World"
@app.route("/user/data")
@kezzico
kezzico / MYSQL.py
Last active August 24, 2023 21:31
Python MySQL Wrapper
# MYSQL.py
import mysql.connector
from dotenv import dotenv_values
config = dotenv_values(".env") # config = {"USER": "foo", "EMAIL": "[email protected]"}
db_config = {
'user': config.get("DATABASE_USER"),
@kezzico
kezzico / file.c
Created August 4, 2023 23:27
client / server UDP communication in C
//Program by Lee Irvine
// client.c
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <string.h>
#include <stdlib.h>
#include <arpa/inet.h>
@kezzico
kezzico / python-virtual-environment.md
Last active October 30, 2023 20:07
Python: Setup a Virtual Environment

Python: Virtual Environments

A virtual environment is a sandbox for packages. Pip's default behavior is system level. However, packages installed in different virtual environment do not co-mingle. The ideal is for each project to have its own distinct virtual environment.

This is especially important on team projects. The virtual environment provides a means to a standard for packages. Identifying project dependencies and which package versions have already been tested against the code.

HOWTO:

It is common to see virtual environments named after the project it represents. The virtual enviromment in this sample will be called venv.

@kezzico
kezzico / make-a-mermaid-from-paste.sh
Created August 11, 2023 17:28
MacOS users can use pbpaste to make diagrams
#!/bin/zsh
out=$1
if [[ -z $out ]]; then
echo "usage [outputfile]"
fi
pbpaste | mmdc - -o $out --width 1600 --theme dark -b black;