Skip to content

Instantly share code, notes, and snippets.

@mrm8488
mrm8488 / create_ds.py
Last active July 19, 2024 19:58
Create dataset with magpie technique and ollama server
# Original idea: https://www.linkedin.com/feed/update/urn:li:activity:7210982019751661568/
# Original script: https://github.com/rasbt/LLMs-from-scratch/blob/main/ch07/05_dataset-generation/llama3-ollama.ipynb
# Make sure have your ollama server runing
# and pip install tqdm datasets
# Note that the instruction datasets created here are for educational purposes. However, it is the users' duty to ensure that their use adheres to the terms of the relevant licensing agreements with Meta AI's Llama 3.
import urllib.request
import json
import argparse
from tqdm import tqdm
@levelsio
levelsio / gist:5bc87fd1b1ffbf4a705047bebd9b4790
Last active November 5, 2024 18:04
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
@tylermorganwall
tylermorganwall / 3d_table.R
Last active April 19, 2023 11:54
"RStudio Table Contest" 3D Table Render
library(rayrender)
make_legs = function(x=0,y=0,z=0) {
csg_translate(y=-5,
csg_combine(
csg_rotate(
csg_pyramid(z=z,x=x,y=y, height = 10), pivot_point = c(x,5,y),up = c(0,-1,0)),
csg_box(x=x,z=z,y=2.5, width = c(1,5,1)), operation = "subtract"))
}
@dorkness-io
dorkness-io / newproject.sh
Last active June 8, 2020 07:16
A script to simplify the creation of new pyenv-virtualenv environments.
#!/bin/sh
# This script automates most the dirty work in configuring new Python virtual
# environments. It requires that you've installed pyenv and pyenv-virtualenv.
display_usage() {
echo "\nThis script creates and activates pyenv-virtualenv environments."
echo "It requires that you have pyenv and pyenv-virtualenv installed."
echo "\nUsage: $0 <project_name> <python_version>\n"
echo "Example: $0 new_project 3.8.2\n"
@bessarabov
bessarabov / gist:674ea13c77fc8128f24b5e3f53b7f094
Last active August 23, 2024 19:11
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zappingseb
zappingseb / index.php
Last active February 12, 2019 05:34
Medium to r-bloggers
<?php
header('Content-Type: text/xml');
$xml = new DOMDocument;
$url = "https://medium.com/feed/@zappingseb";
$xml->load($url);
$book = $xml->documentElement;
// we retrieve the chapter and remove it from the book
@amitmerchant1990
amitmerchant1990 / stylish.css
Last active March 26, 2021 02:21
Revert back to good old GitHub Homepage
/**
1. Install the Stylish(https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en) extension for Chrome.
2. Open up extension options and paste the CSS mentioned below.
3. Specify the "URLs on the domain" to be `github.com`.
4. Add a title and save.
*/
.dashboard-sidebar {
float: right;
padding-right: 10px;
#!/bin/bash
TODAY=`date +%Y-%m-%d`
TODAY_MD=`date +%B\ %d,\ %Y`
YEAR=`date +%Y`
PACKAGENAME=$1
##
## CHANGE ME!!!