Skip to content

Instantly share code, notes, and snippets.

@k1000
k1000 / package.json
Created August 18, 2024 06:45 — forked from louis030195/package.json
A 100% local and typescript LLM in Apple Shortcut to be used everywhere on your computer in <1 second
{
"dependencies": {
"@llama-node/llama-cpp": "^0.0.32",
"llama-node": "^0.0.32"
},
"devDependencies": {
"@types/node": "^18.16.3"
}
}
CURRICULUM VITAE
Kamil Selwa
Email: [email protected]
Phone: +39 345 813 0128
GitHub: https://github.com/k1000/
LinkedIn: https://www.linkedin.com/in/kamilselwa/
Nationality: Polish
Residence: Italy
@k1000
k1000 / proof-of-virginity-vocab.md
Last active March 17, 2023 16:03
Proof of Virginity - VC
@k1000
k1000 / index.js
Last active March 16, 2021 18:59
implementation Marvel API, mongodb, Auth0 (Github)
const crypto = require("crypto");
const fetch = require('node-fetch');
const express = require('express');
const lusca = require('lusca');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const session = require('express-session');
const passport = require('passport');
const GithubStrategy = require('passport-github').Strategy;
require('dotenv').config();
@k1000
k1000 / index.js
Created March 16, 2021 13:17
marvelouz
const express = require('express')
const crypto = require("crypto");
const fetch = require('node-fetch');
const mongoose = require('mongoose');
const { auth } = require('express-openid-connect');
require('dotenv').config();
const PORT = process.env.PORT || 5000
const mongo_uri = `mongodb+srv://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@cluster0.u4tzh.mongodb.net/myFirstDatabase?retryWrites=true&w=majority`;
import {AsyncStorage } from 'react-native';
import {Actions} from 'react-native-router-flux';
import Calendar from '../app/calendar';
const moment = require('moment');
const callib = require('./callib.js');
const aspects = require('../data/favorable_days.json');
const constellations = require('../data/constellations.json');
const signsByNum = require('../data/signs_num.json');
const signsByName = require('../data/tib_signs.json');
# FUNK from https://colab.research.google.com/drive/12rWn1enSZP6OTgYgRT1OYFhFnt7QFfIu#scrollTo=dwe_prwCn2HH
def moving_average(df, n):
MA = pd.Series(df['Close'].rolling(n, min_periods=n).mean(), name='MA_' + str(n))
df = df.join(MA)
return df
def exponential_moving_average(df, n):
EMA = pd.Series(df['Close'].ewm(span=n, min_periods=n).mean(), name="EMA_" + str(n))
df = df.join(EMA)
// remove hard spaces
let bodyHTML = document.body.innerHTML;
bodyHTML = bodyHTML.replace(/&#160;/gim, ' ');
bodyHTML = bodyHTML.replace(/\u00a0/gim, ' '); // &nbsp;
bodyHTML = bodyHTML.replace(' ', ' ');
bodyHTML = bodyHTML.replace(/<[^/>]+>[ \n\r\t]*<\/[^>]+>/gim, ''); // remove empry tags
bodyHTML = bodyHTML.replace(/,([^ ])/gim, ', $1'); // fixes commas not followed by space
//bodyHTML = bodyHTML.replace(/”([^ ])/gim, '” $1'); // fixes not followed by space
//bodyHTML = bodyHTML.replace(/\.([^ <\d])/gim, '\. $1'); // fixes dot stops not followed by space
//bodyHTML = bodyHTML.replace(/\:([^ ])/gim, '\: $1');
#FFmpeg
downsample many mp3 many files
for i in *.mp3; do ffmpeg -i "$i" -ac 1 -ab 64000 -ar 22050 "${i%.mp3}-64kbps.mp3"; done
#concat many files
ffmpeg -safe 0 -f concat -i <(find . -type f -name '*' -printf "file '$PWD/%p'\n" | sort) -c copy output.mkv
@k1000
k1000 / honeypot.py
Created January 11, 2018 09:53
Django HoneypotFormMixin
from django import forms
class HoneypotFormMixin(object):
"""Keep away spam bots trying to submit name"""
def __init__(self, *args, **kwargs):
super(HoneypotFormMixin, self).__init__(*args, **kwargs)
self.fields.update(
{"name": forms.CharField(required=False)}