Skip to content

Instantly share code, notes, and snippets.

httpProxy = require('http-proxy')
init_http_proxy_server = () =>
_remember_me_check_for_write_access_to_project = (opts) ->
opts = defaults opts,
project_id : required
remember_me : required
cb : required # cb(err, has_access)
account_id = undefined
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 6, 2024 10:42
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@williamstein
williamstein / gist:5d1f5f77614c9a48d5adc9c2078647a8
Created September 28, 2022 21:57
converting local file imports
#!/usr/bin/env node
import * as fs from 'fs';
import * as path from 'path';
// https://gist.github.com/lovasoa/8691344
async function* walk(dir) {
for await (const d of await fs.promises.opendir(dir)) {
const entry = path.join(dir, d.name);
if (d.isDirectory()) {
@subtleGradient
subtleGradient / importUMD.js
Last active May 6, 2024 10:41
import(UMD)
export default async (url, module = {exports:{}}) =>
(Function('module', 'exports', await (await fetch(url)).text()).call(module, module, module.exports), module).exports
@bakerac4
bakerac4 / controllers.application.js
Last active May 6, 2024 10:41
Async/Await Loading Issue
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@malj
malj / html-import.js
Created December 7, 2022 13:25
<html-import src="path/to/file.html"></html-import>
export default class HTMLImport extends HTMLElement {
#abortController = new AbortController()
async connectedCallback() {
let src = this.getAttribute("src")
if (src === null) {
console.warn("<html-import> element requires attribute \"src\"")
this.remove()
return
}
@AndreyBelym
AndreyBelym / foo.js
Last active May 6, 2024 10:41
TestCafe import/export
export default function () {
return window.location.toString();
}
@tubackkhoa
tubackkhoa / imports.js
Created January 25, 2024 09:13
import
const glob = require('glob');
const util = require('util');
const globPromise = util.promisify(glob);
const importArr = [];
const exportArr = ['export default {'];
const paths = [
'node_modules/@tharsis/proto/dist/proto/evmos/**/*.js',
'node_modules/@tharsis/proto/dist/proto/ethermint/**/*.js',
import llama_cpp
import re
import json
# Model configuration
# tested with mistral, llama2, llama3, and phi3
model_path = "/path/to/model"
base_llm = llama_cpp.Llama(model_path, seed=42, n_gpu_layers=-1, n_ctx=4096, verbose=False, temperature=0.0)
@playerx
playerx / .env
Last active May 6, 2024 10:39
Script for importing batch data import from csv to MongoDB
MONGO_DB=