Skip to content

Instantly share code, notes, and snippets.

View willybeans's full-sized avatar

Will Wedmedyk willybeans

View GitHub Profile
@willybeans
willybeans / Context.tsx
Created February 10, 2024 15:14
Websocket connection using context provider in React Native Expo using typescript
import { createContext } from "react";
import { Websocket } from "./types";
const Context = createContext<Websocket>({} as Websocket);
export default Context;
@willybeans
willybeans / chi-gorilla-websocket-example.go
Last active February 9, 2024 15:47
Connect gorilla websockets to chi router
package main
import (
"net/http"
"time"
"github.com/willybeans/freedu_go/handlers"
"github.com/willybeans/freedu_go/logger"
"github.com/go-chi/chi"
@willybeans
willybeans / aws_connect.js
Last active January 26, 2024 00:46
fetching files from S3 bucket in AWS
const aws = require("@aws-sdk/client-s3");
//
// Throws an error if the any required environment variables are missing.
//
if (!process.env.AWS_ACCESS_KEY_ID) {
throw new Error(
"Please specify the name of an AWS storage account in environment variable AWS_ACCESS_KEY_ID."
);
Binary found at /Users/williamwedmedyk/osx-gcc/node_modules/node-sass/vendor/darwin-x64-48/binding.node
Testing binary
Binary has a problem: Error: dlopen(/Users/williamwedmedyk/osx-gcc/node_modules/node-sass/vendor/darwin-x64-48/binding.node, 1): Symbol not found: __ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info
Referenced from: /Users/williamwedmedyk/osx-gcc/node_modules/node-sass/vendor/darwin-x64-48/binding.node
Expected in: flat namespace
in /Users/williamwedmedyk/osx-gcc/node_modules/node-sass/vendor/darwin-x64-48/binding.node
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
@willybeans
willybeans / testData.json
Last active January 1, 2017 07:40
Error in 4. Working with test data
When i try to "npm run dev" with the JSON test data file im receiving this error:
ERROR in ./src/testData.json
Module build failed: SyntaxError: Unexpected token
in JSON at position 262
at Object.parse (native)
at Object.module.exports (/Users/williamwedmedyk/jsPrac/jscomplete/node_modules/json-loader/index.js:11:48)
@ ./src/index.js 11:16-37
here is my index.js file: