- Microsoft Visual Studio Code: build in git-support, auto-complete, TypeScript paramater lookup.
- Bitbucket for GIT: free private repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const https = require('https'); | |
function fetchJSON(url) { | |
return new Promise((resolve, reject) => { | |
https.get(url, (response) => { | |
if (response.statusCode !== 200) { | |
reject(new Error(`HTTP error! status: ${response.statusCode}`)); | |
return; | |
} | |
let data = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Via: Austin @ https://discord.com/channels/1086345563026489514/1086345563026489517/1239210064783474688 | |
//Small updates via https://gist.github.com/insilications/a3ce3add092df165e5521eb2be0e73be for tokenizer, stats box. | |
//Edits: - Include prompt field, version 2 | |
// - estimate for GPT 4o/sonnet & Opus at 2024-06-02 pricing | |
// ==UserScript== | |
// @name OpenAI Token Counter for LibreChat | |
// @namespace http://tampermonkey.net/ | |
// @version 1.3 | |
// @description Automatically count tokens of chat content on LibreChat | |
// @author ChatGPT 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Toastify from 'toastify-js'; //https://github.com/apvarun/toastify-js/blob/master/README.md | |
import "toastify-js/src/toastify.css"; | |
//To use: | |
//import toast from '../web_toast.js'; | |
//toast(message,class(optional), options) | |
//My default is that the toast stays open until dismissed and defaults to bootstrap's "bg-info" if no class is specified. | |
//NOTE: In an SPA, you'll need to clear any persistent toasts on page switch | |
//use import {closeAll as clearToasts} from './web_toast.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
export let params={}; | |
export let service=null; | |
export let id=null; | |
import Fa from 'svelte-fa' | |
import { faEdit, faPlus, faTrash } from '@fortawesome/free-solid-svg-icons'; | |
import feathers from '../web_feathers.js'; | |
const rest = feathers.service('logs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/node | |
var nodemailer = require("nodemailer"); | |
var transport = nodemailer.createTransport("sendmail"); | |
function fix_len(num, len){ | |
if(len<=5) return ("00000" + num).slice(-len); | |
else { | |
var seed="0000000000"; | |
while(seed.length<len) seed+=seed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sample file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`show create table logs_fs` | |
CREATE TABLE `logs_fs` ( | |
`uuid` char(36) DEFAULT NULL, | |
`host` varchar(4) DEFAULT NULL, | |
`date` datetime(6) NOT NULL, | |
`hrtime` bigint(20) unsigned NOT NULL, | |
`level` tinyint(4) DEFAULT NULL, | |
`value` text, | |
KEY `uuid` (`uuid`), |
I hereby claim:
- I am avimar on github.
- I am avimarcus (https://keybase.io/avimarcus) on keybase.
- I have a public key whose fingerprint is 1AFA CC40 32FD 2FE9 BCE3 88FE D5DD 1501 34E0 ABD8
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*License: MIT*/ | |
function isracardCheck(num) {//algorithm explanation: https://web.archive.org/web/20140227235803/http://povolotski.me/2013/09/24/isracard-credit-card-number-validation-2/ | |
if(typeof num !== 'number') num=''+num; | |
if(num.length < 8 || num.length > 9) return false; | |
var sum=0; | |
num.split('').forEach(function(val,key){ | |
sum+=parseInt(val,10)*(num.length-key); | |
}) | |
return sum % 11 == 0; | |
} |
NewerOlder