Skip to content

Instantly share code, notes, and snippets.

View williamtran29's full-sized avatar
🏠
Working from home

William Tran williamtran29

🏠
Working from home
  • Freelancer
  • Silicon Valley
View GitHub Profile
@williamtran29
williamtran29 / app.js
Created February 13, 2019 16:38 — forked from ekryski/app.js
How to use socket.io in React Native
// You need to set `window.navigator` to something in order to use the socket.io
// client. You have to do it like this in order to use the debugger because the
// debugger in React Native runs in a webworker and only has a getter method for
// `window.navigator`.
window.navigator.userAgent = 'ReactNative';
// Need to require instead of import so we can set the user agent first
// This must be below your `window.navigator` hack above
const io = require('socket.io-client/socket.io');
const socket = io('http://chat.feathersjs.com', {
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@williamtran29
williamtran29 / finetune_llama_v2.py
Created August 9, 2023 13:48 — forked from younesbelkada/finetune_llama_v2.py
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@williamtran29
williamtran29 / mlx_finetuning_gemma.ipynb
Created March 16, 2024 05:43 — forked from alexweberk/mlx_finetuning_gemma.ipynb
MLX Fine-tuning Google Gemma
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Directory structure:
└── getomni-ai-zerox/
β”œβ”€β”€ README.md
β”œβ”€β”€ commitlint.config.js
β”œβ”€β”€ jest.config.js
β”œβ”€β”€ LICENSE
β”œβ”€β”€ Makefile
β”œβ”€β”€ MANIFEST.in
β”œβ”€β”€ package.json
β”œβ”€β”€ pyproject.toml