Skip to content

Instantly share code, notes, and snippets.

@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active July 20, 2023 06:51
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM
View llama2-mac-gpu.sh
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
wget "https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/main/${MODEL}"
@kripod
kripod / package.json
Created May 6, 2020 10:30
Creating minified ESM+CJS bundles from TypeScript with Rollup and Babel in a monorepo, utilizing conditional exports
View package.json
{
"name": "to-be-added",
"version": "0.0.0",
"sideEffects": false,
"exports": {
".": {
"import": "./dist-esm/bundle.min.mjs",
"require": "./dist-cjs/bundle.min.cjs"
},
"./server": "./server/index.js"
@amalleo25
amalleo25 / telemetry-blocklist
Created May 20, 2018 02:40
Telemetry Blocklist for pfBlockerNG
View telemetry-blocklist
#
# I did not create this list. I pulled the list from the following repo:
# https://github.com/W4RH4WK/Debloat-Windows-10/blob/master/scripts/block-telemetry.ps1
# I formatted the list to be used with pfBlockerNG.
#
184-86-53-99.deploy.static.akamaitechnologies.com
a-0001.a-msedge.net
a-0002.a-msedge.net
a-0003.a-msedge.net
a-0004.a-msedge.net
@scbizu
scbizu / revalid.go
Created March 7, 2017 12:49
How Golang solve the invalid UTF-8 character?
View revalid.go
package main
import (
"fmt"
"unicode/utf8"
)
func main() {
s := "a\xc5z"
fmt.Printf("%q\n", s)
@bmaupin
bmaupin / free-backend-hosting.md
Last active July 20, 2023 06:46
Free backend hosting
View free-backend-hosting.md
@ArturT
ArturT / api_controller.rb
Last active July 20, 2023 06:44
How to rescue ActionDispatch::Http::MimeNegotiation::InvalidType in API controller for Rails 6.1+ and render nice JSON error. Learn more how you could run RSpec/Minitest tests faster in Rails app https://docs.knapsackpro.com/2020/how-to-speed-up-ruby-and-javascript-tests-with-ci-parallelisation
View api_controller.rb
# This is example how to rescue from exception ActionDispatch::Http::MimeNegotiation::InvalidType
# and show nice JSON error in your API
module API
class BaseController < ActionController::API
def process_action(*args)
super
rescue ActionDispatch::Http::MimeNegotiation::InvalidType => exception
# set valid Content-Type to be able to call render method below
request.headers['Content-Type'] = 'application/json'
render status: 400, json: { errors: [exception.message] }
View install.sh
## shebang https://ko.wikipedia.org/wiki/%EC%85%94%EB%B1%85 참고
#!/bin/sh
src_dir="contrib"
near_postfix="near"
network="mainnet"
near_source="nearcore" # nearcore or datalake
migrate_from=""
use_snapshots=1
@NANDHINI7390
NANDHINI7390 / index.html
Created July 20, 2023 06:41
Weather api
View index.html
<h1 style="color:#148F77 "><b><i><center> Weather App&#127777 </i></b></center></h1>
<center><input type='search' placeholder='enter the city ' id="city" class="search-bx" name='cityname'style= "width:50%;background-color: white;padding: 12px 20px;margin: 10px 0;display: inline-block;border: 1px solid green;border-radius: 6px;box-sizing: content-box "></center>
<br>
<center><button id="search-button" style="color: yellow; background-color: grey">search</button><center>
<br>
<div>
<div id="location " ></div>
<div id="temp" ></div>
</div>
@simonwagner
simonwagner / .gitconfig
Created March 14, 2014 17:04
Fixup alias for simply fixing a commit.
View .gitconfig
#This will the fixup command to git
#git fixup $commit will use your current index to fixup the specified commit
#This is done by doing git commit --fixup $commit and then using rebase with autosquash
#Based upon http://stackoverflow.com/a/21148981/460564
[alias]
fixup = "!sh -c '(git diff-files --quiet || (echo Unstaged changes, please commit or stash with --keep-index; exit 1)) && COMMIT=$(git rev-parse $1) && git commit --fixup=$COMMIT && git rebase -i --autosquash $COMMIT~1' -"