Skip to content

Instantly share code, notes, and snippets.

View svngoku's full-sized avatar
🦩
Your favorite Teachlead 🥸

svngoku

🦩
Your favorite Teachlead 🥸
View GitHub Profile
@mlabonne
mlabonne / finetune_llama2.py
Last active May 14, 2024 16:33
Easy Llama 2 fine-tuning script (📝 Article: https://tinyurl.com/finetunellama2)
# Based on younesbelkada/finetune_llama_v2.py
# Install the following libraries:
# pip install accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers==4.31.0 trl==0.4.7 scipy
from dataclasses import dataclass, field
from typing import Optional
import torch
from datasets import load_dataset
from transformers import (
@phortuin
phortuin / postgres.md
Last active July 16, 2024 04:19
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql@14

(The version number 14 needs to be explicitly stated. The @ mark designates a version number is specified. If you need an older version of postgres, use postgresql@13, for example.)

@itsabdessalam
itsabdessalam / copy.js
Last active September 29, 2020 00:09
Copy to clipboard
// if code snippet is inside input or textarea tags
function copy() {
var codeSnippet = document.querySelector("#code-snippet");
codeSnippet.select();
document.execCommand("copy");
}
document.querySelector("#copy").addEventListener("click", copy);
// if code snippet is inside pre or code tags
function copy() {
@tjpeter
tjpeter / SQL Movie - Rating Query Exercises Extras.sql
Last active January 23, 2023 01:56
StanfordOnline - Databases: Relational Databases and SQL
--- 1. Find the names of all reviewers who rated Gone with the Wind.
SELECT DISTINCT name
FROM Movie
JOIN rating USING(mID)
JOIN reviewer USING(rID)
WHERE title = "Gone with the Wind";
--- 2. For any rating where the reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars.
---
title: "Rmarkdown"
author: "me"
date: "7/17/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
@neodigm
neodigm / music-ad-blocker.js
Last active October 26, 2023 22:30
Automatically mute the Music player when Ads are playing and unmute when they are done (in Chrome).
let spotADify = ( (_d, _q, _t) => {
let eS = _d.querySelector( _q ), bS = true;
if( eS ){ // 🏖️ Play your Jams! 🎶
bS = ( eS.getAttribute("aria-label") == "Mute" );
setInterval( () => {spotADify.tick();}, _t);
return {
"tick": () => {
if((_d.title.indexOf("Adve") != -1) || (_d.title.indexOf("Spoti") != -1)){
if( bS ){ eS.click(); bS=!true; }
}else{
@andrew-curthoys
andrew-curthoys / udemy_hadoop_training_course_notes.md
Last active January 23, 2023 01:57
Udemy Hadoop Training Course Notes

Udemy - "The Ultimate Hands-On Hadoop - Tame Your Big Data!" Course Notes

What is Hadoop? "Hadoop is an open source software platform for distributed storage and distributed processing of very large data sets on computer clusters built from commodity hardware" - Hortonworks

Features

  • Distributed storage: stores data across many hard drives & has backup copies
@svngoku
svngoku / workflow.js
Created December 3, 2019 16:34
workflow
const choice = ['Aléatoire','Permanent','Quotidien','Inconnue'];
const priority = ['Urgent', 'Modéré', "Demande dinformation"];
const status = ['A TRAITER', 'EN COURS', 'COMPLEMENT INFOS', 'A REPRENDRE', 'CLOS'];
let actualStatusState = [];
let demande = prompt('Status: ');
function Workflow() {
if(demande === 'A TRAITER') {
console.log('Statut: ', demande);
@mgol
mgol / jquery-es6-example.md
Last active October 12, 2023 10:34
jQuery ES6 modules example usage

jQuery source is now authored using ES6 modules. It's possible to use them directly in the browser without any build process.

To test it locally, first clone the jQuery repository:

git clone git@github.com:jquery/jquery.git

Then, write the following index.html file:

@whoisryosuke
whoisryosuke / Update-branch.md
Created September 17, 2019 17:38 — forked from santisbon/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master