Skip to content

Instantly share code, notes, and snippets.

View iksnae's full-sized avatar

K Mills iksnae

View GitHub Profile
import os
import autogen
import memgpt.autogen.memgpt_agent as memgpt_autogen
import memgpt.autogen.interface as autogen_interface
import memgpt.agent as agent
import memgpt.system as system
import memgpt.utils as utils
import memgpt.presets as presets
import memgpt.constants as constants
import memgpt.personas.personas as personas
@iksnae
iksnae / api.yml
Created June 17, 2023 15:30
screenplayer-api
version: '3'
services:
openapi-mock:
container_name: openapi_mock
image: muonsoft/openapi-mock
ports:
- '8080:8080'
environment:
- OPENAPI_MOCK_SPECIFICATION_URL=/app/api.yml
volumes:
@ravihansa
ravihansa / index.js
Created February 11, 2020 10:11
Read text file in AWS S3 using Nodejs~
const s3 = require('aws-sdk/clients/s3'); // npm install aws-sdk
async function readFile() {
try {
var s3Data = await readTxtFile();
console.log(s3Data);
} catch (err) {
console.log('Error:', err);
}
}
@RobertMenke
RobertMenke / query-param.codable.swift
Last active February 28, 2023 10:24
Swift Codable to URL Query String
import Foundation
import DictionaryCoding
/// Note: This relies on the DictionaryCoding package https://github.com/elegantchaos/DictionaryCoding
struct QueryParamEncoder {
func encode<T: Encodable>(_ item: T) throws -> String {
let encoder = DictionaryEncoder()
let encoded: [String: Any] = try encoder.encode(item)
let queryParams = encodeDictionary(encoded)
@4np
4np / HowTo use xcconfig or plist with SPM.md
Last active August 5, 2024 11:06
How to use a .xcconfig file and a .plist with a Swift Package Manager based project.

How to use a .xcconfig file and a .plist file with SPM

Worth a read for some more context.

Create a Package.xcconfig file

Create the file in the root of the project (where your Package.swift file lives as well), and use the following contents:

/// Package.xcconfig
@codecitizen
codecitizen / serverless.yml
Created November 22, 2018 20:42
A serverless.yml file configuring a AWS ElastiCache redis instance that is accessible by all AWS Lambda functions deployed by this serverless function.
service: my-service
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:stage, 'dev'}
environment:
REDIS_HOST:
"Fn::GetAtt": [ElasticCacheCluster, RedisEndpoint.Address]
functions:
@Sorix
Sorix / Package.swift
Last active April 8, 2025 05:41
Example of Package.swift with environment variables support
// swift-tools-version:4.0
import PackageDescription
#if os(Linux)
import Glibc
#else
import Darwin.C
#endif
enum Enviroment: String {
@miguelmota
miguelmota / webdriver_full_page_screenshots.js
Last active October 13, 2025 01:08
Selenium Webdriver Node.js take screenshots of entire page
var webdriver = require('selenium-webdriver')
var assert = require('assert')
var fs = require('fs')
// Input capabilities
var capabilities = {
'browserName' : 'Chrome',
'browser_version' : '66.0',
'os' : 'Windows',
'os_version' : '10',
import Darwin.C
let zero = Int8(0)
let transportLayerType = SOCK_STREAM // TCP
let internetLayerProtocol = AF_INET // IPv4
let sock = socket(internetLayerProtocol, Int32(transportLayerType), 0)
let portNumber = UInt16(4000)
let socklen = UInt8(socklen_t(MemoryLayout<sockaddr_in>.size))
var serveraddr = sockaddr_in()
serveraddr.sin_family = sa_family_t(AF_INET)
serveraddr.sin_port = in_port_t((portNumber << 8) + (portNumber >> 8))
@OhTerryTorres
OhTerryTorres / SpriteKitLevelsByJSON.md
Last active July 14, 2023 15:16
Creating levels for a SpriteKit game using JSON

Making Levels in a SpriteKit game from JSON

I’m making a SpriteKit game for a wine shop in Boston’s North End. We want it to

  1. have an old-school, chunky, arcadey hack-and-slash feel
  2. properly convey that old-school feel using effortless touch controls
  3. have its levels built (and potentially updated after launch) using an external data file

I want to talk about how I plan on implementing that last one: level data from an external file.