Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gwangjinkim
gwangjinkim / install-and-start-postgresql-in-conda-locally
Last active April 23, 2024 05:27
How to install and run postgresql in conda
This gist I write, because I couldn't find step by step instructions
how to install and start postgresql locally (using conda within a conda environment - with the result
that you can run it without sudo/admin rights on your machine!)
and not globally in the operating system (which requires sudo/admin rights on that machine).
I hope, this will help especially people new to postgresql (and those who don't have sudo/admin rights on a specific machine but want
to run postgresql there)!
####################################
# create conda environment

TL;DR

When Riot Games introduces the Vanguard anti-cheat to League of Legends, you should STOP playing and you should not install the anti-cheat when you get the pop-up. Vanguard is a kernel-level anticheat and these anticheats operate at a privilege level HIGHER THAN YOUR OWN. The anti-cheat can do things that even you can't do, without asking or letting you know. It's like Riot installing a camera in every room of your house and getting a copy of every key inside.

Here is just one example of what they can do: https://www.theregister.com/2013/11/20/esea_gaming_bitcoin_fine/

https://www.wired.com/2013/11/e-sports/

Who am I?

@sindresorhus
sindresorhus / esm-package.md
Last active April 23, 2024 05:25
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@rain-1
rain-1 / 000-crossword-solving.md
Last active April 23, 2024 05:25
crossword-solving-with-gpt.md

Solving crosswords with GPT

This is my research report. I've included a lot of the code and chat interactions for people to read through if interested. I worked on this crossword https://www.theguardian.com/crosswords/quick/16553

I had a vision for a GPT powered crossword solver. My idea is that it would do a tree search over GPT generated guesses that would include the knowns so far, like:

givens

I didn't end up doing that because ChatGPT and GPT-4 are terrible at questions involving the length of words, or guessing words that contain specific letters at specific locations. It can sometimes do them but usually fails. I think this is because it's token based. I am curious whether a character based LLM would be better at such tasks.

@rain-1
rain-1 / On Llamafile.md
Last active April 23, 2024 05:24
On Llamafile

On Llamafile not making sense

The LLamafile project doesn't make sense.

The claim is that it is "bringing LLMs to the people", but you could already run an LLM - which is a large binary file containing lots of floating point numbers - by using llama.cpp.

Llamafile joins a compiled binary program to run LLMs with a weights binary into a single file. This isn't a useful goal. you could simply distribute a zip containing an .exe and a weights file together. Or better still: Decouple the program that runs these chatbots from the chatbot weights.

Imagine if PNG files were also an executable that could pop open a window that displays a PNG on your computer. There is a reason we don't do this: It's not good engineering.

package com.example.anshu11kbbsr
import com.google.api.client.googleapis.testing.json.GoogleJsonResponseExceptionFactoryTesting
import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest
@SpringBootTest
class Anshu11kbbsrApplicationTests {
fun gq(){
@svex99
svex99 / data-table.svelte
Created April 20, 2024 08:23
Svelte data-table with generics and back-end pagination (shadcn-svelte)
<script context="module" lang="ts">
export type Column<T> = {
accessor: keyof T;
header: string;
format?(item: T): string;
cell?: (item: T) => any;
};
</script>
<script lang="ts" generics="T extends { id: string }">
@roycewilliams
roycewilliams / pwnedpasswords-v2-top20k.txt
Last active April 23, 2024 05:22
pwnedpasswords-v2-top20k.txt
#------------------------------------------------------------------------------
# Top 20K hashes from the Troy Hunt / haveibeenpwned Pwned Passwords list v2 (2018-02-21)
# with frequency count and cracked plaintext passwords
#
# The latest version of this file can be found here:
# https://gist.github.com/roycewilliams/281ce539915a947a23db17137d91aeb7
#
# NOTE: THIS FILE IS DEPRECATED.
# The equivalent of this file, but based on v6 of the Pwned Passwords, is here:
# https://gist.github.com/roycewilliams/226886fd01572964e1431ac8afc999ce
@DakotaLMartinez
DakotaLMartinez / instructions.md
Last active April 23, 2024 05:21
Adding an SSH key to GitHub (Mac OS X or Linux)

You need to do this if you try this command:

ssh -T git@github.com

and you get something that says

git@github.com: Permission denied (public key).
@zhuziyi1989
zhuziyi1989 / URL Schemes.md
Last active April 23, 2024 05:19
常用 URL Schemes 收集。

** 由于此文年事已久,可能某些URL Schemes已失效,可在评论区留言指出!(最后更新于 2024.4.16)

关于 URL Scheme 你知道多少?

iOS系统中

由于苹果的各应用都是在沙盒中,不能够互相之间访问或共享数据。但是苹果还是给出了一个可以在APP之间跳转的方法:URL Scheme。简单的说,URL Scheme就是一个可以让 APP 相互之间可以跳转的协议。每个 APP 的URL Scheme都是不一样的,如果存在一样的URL Scheme,那么系统就会响应先安装那个 APP 的URL Scheme,因为后安装的 APP 的URL Scheme被覆盖掉了,是不能被调用的。

Android系统中