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 / mlx_finetuning_gemma.ipynb
Created March 16, 2024 05:43 — forked from alexweberk/mlx_finetuning_gemma.ipynb
MLX Fine-tuning Google Gemma
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
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 / 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', {
# for development
pm2 start npm --name "next" -- run dev
# for production
npm run build
pm2 start npm --name "next" -- start
"scripts": {
"start": "node ./node_modules/.bin/pm2 start app.js -i max --attach"
@williamtran29
williamtran29 / .eslintrc
Created May 6, 2018 09:44 — forked from radiovisual/.eslintrc
React Native AirBnB ESLint Config
{
"parser": "babel-eslint",
"plugins": [
"react",
"react-native"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
set mouse=""
set tabstop=2
set clipboard=unnamedplus
set softtabstop=2
set expandtab
set shiftwidth=2
set autoread
set autoindent
set si
set nobackup
@williamtran29
williamtran29 / elixir_timer_interval.exs
Created December 23, 2017 18:04 — forked from kandros/elixir_timer_interval.exs
Set an interval in elixir-lang using erlang timer module
:timer.apply_interval(1000, IO, :puts, ["weeeee"]) # millisends, module, function as atom, list of arguments
@williamtran29
williamtran29 / Ethereum-Rinkeby
Created October 15, 2017 13:43
0x10dDBD1079f4Ac4797e9A374CDDB8BC9F84fCe39
0x10dDBD1079f4Ac4797e9A374CDDB8BC9F84fCe39
import { compliment, compose, get } from 'lodash/fp';
import { connect } from 'react-redux';
import { branch, renderComponent } from 'recompose';
const selectIsAuthenticated = state => ({
isAuthenticated: Boolean(state.currentUser),
});
const withAuth = compose(
connect(selectAuthorizationStatus),