Skip to content

Instantly share code, notes, and snippets.

View nelsonjchen's full-sized avatar

Nelson Chen nelsonjchen

View GitHub Profile
@kylemcdonald
kylemcdonald / function-calling.ipynb
Created June 14, 2023 01:10
Example of OpenAI function calling API to extract data from LAPD newsroom articles.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@spinda
spinda / PROMPT.txt
Created December 28, 2022 22:30
ChatGPT splitting the check
Here is OCR'd text from a receipt:
"Dine-In
#15
<restaurant name redacted>
<address redacted> Phone <phone redacted>
@harold-b
harold-b / IntelGfxUbuntu20.04MacBookPro10-1.md
Last active April 6, 2024 17:49
Enable Intel Graphics on Ubuntu 20.04 on MacBook Pro Mid 2012 Retina (10,1)

How to get Intel graphics working on MacBook Pro mid 2012 (10,1) Ubuntu 20.04:

Ubuntu was intalled with the default nvidia drivers that it brought (I believe 3.90)

Clone https://github.com/0xbb/apple_set_os.efi

For details, see the README.md

Build it:

@mnaberez
mnaberez / nec_78k0_flash.md
Last active April 3, 2024 20:24
NEC 78K0 Flash Vulnerability

NEC 78K0 Flash Vulnerability

Overview

The microcontroller that I studied was removed from a Volkswagen car radio manufactured by Delco (now Delphi). The chip had only Delco markings on the package. It was decapsulated and the markings "NEC D78F0831Y" were found on the die. I reverse engineered the device definition files for the NEC toolchain (RA78K0) and determined that the uPD78F0831Y is a subset of a documented chip, the uPD78F0833Y. The '833Y adds 3 more timers, extended I2C functionality, and adds registers that allow firmware running on the '833Y to reprogram the flash ("self-programming"). Otherwise, the '831Y and '833Y are the same.

The uPD78F0831Y uses the NEC 78K0 core. Note that NEC (now Renesas) produced a number of incompatible cores with similar names such as 78K0S and 78K

@clrung
clrung / clone_all_repos.sh
Last active December 11, 2023 14:34
Clones all repos in a GitHub organization
#!/bin/bash
# Usage: clone_all_repos.sh [organization] <output directory>
ORG=$1
PER_PAGE=100
GIT_OUTPUT_DIRECTORY=${2:-"/tmp/${ORG}_repos"}
if [ -z "$GITHUB_TOKEN" ]; then
echo -e "Variable GITHUB_TOKEN isn't set! Please specify your GitHub token.\n\nMore info: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/"
exit 1
@abbottdev
abbottdev / app.ts
Created June 11, 2019 13:52
Typescript example for creating aws cdk resources using a swaggerfile
import * as cdk from '@aws-cdk/cdk';
import * as SwaggerParser from "swagger-parser";
import convertSwaggerToCdkRestApi from "./swaggerHelper";
SwaggerParser
.parse("./swagger.yaml")
.then(swagger => {
const app = new cdk.App();
let apiGateway = new apigateway.RestApi(this, "My Rest API", {
@CoolOppo
CoolOppo / Cargo.toml
Last active January 2, 2024 10:27
How to compile to a DLL in rust while using it as a normal rust library
[package]
name = "test"
version = "0.1.0"
authors = ["YOU <YOU@users.noreply.github.com>"]
edition = "2018"
[lib]
crate-type = ["cdylib"]
@npearce
npearce / install-docker.md
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start

I bundled these up into groups and wrote some thoughts about why I ask them!

If these helped you, I'd love to hear about it!! I'm on twitter @vcarl_ or send me an email carl.vitullo@gmail.com

Onboarding and the workplace

https://blog.vcarl.com/interview-questions-onboarding-workplace/

  • How long will it take to deploy my first change? To become productive? To understand the codebase?
  • What kind of equipment will I be provided? Will the company pay/reimburse me if I want something specific?
@moznion
moznion / docker-compose.yml
Last active May 15, 2018 01:19
docker-compose file for kibana with oauth2_proxy
version: '2.1'
services:
kibana:
image: 'docker.elastic.co/kibana/kibana-oss:6.1.0'
elasticsearch:
image: 'docker.elastic.co/elasticsearch/elasticsearch-oss:6.1.0'
oauth2-proxy:
image: 'a5huynh/oauth2_proxy:2.2'