Skip to content

Instantly share code, notes, and snippets.

@actuallyjamez
actuallyjamez / svelte-cookies.ts
Created March 22, 2025 15:37
Better Auth plugin to set cookies on server api requests
import type { BetterAuthPlugin } from "better-auth";
import { createAuthMiddleware } from "better-auth/api";
import { parseSetCookieHeader } from "better-auth/cookies";
export const svelteCookies = () => {
return {
id: "svelte-cookies",
hooks: {
after: [
{
@davideuler
davideuler / agent loop
Created March 10, 2025 04:29 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@Maxiviper117
Maxiviper117 / CSRFProtectionSveltekit.md
Last active October 31, 2025 10:35
Guide: Implementing CSRF Protection in SvelteKit

Guide: CSRF Protection in SvelteKit

Cross Site Request Forgery (CSRF) is when a browser sends a state changing request to your app without the user intending to do so. SvelteKit already ships with CSRF checks based on the request origin. In most cases you should keep that. Use a custom hook only when you need finer control.


1. Configure SvelteKit CSRF

📂 svelte.config.ts

@RafaelGSS
RafaelGSS / .zshrc
Created January 12, 2025 02:32
Use npx with Node.js Permission Model
alias npx-safe='function _npx_safe() {
local node_opts="--permission --allow-fs-read=$(npm prefix -g) --allow-fs-read=$(npm config get cache)"
local package=""
local package_args=()
while [[ $# -gt 0 ]]; do
if [[ "$1" == --* ]]; then
# Anything starting with `--` goes into node_opts
node_opts+=" $1"
const { createServer } = require('http');
createServer((req, res) => {
res.writeHead(200, {
Connection: 'Transfer-Encoding',
'Content-Type': 'text/html; charset=utf-8',
'Transfer-Encoding': 'chunked'
});
res.write(`
@onosendi
onosendi / das-hotkey-generator.py
Last active October 28, 2022 09:11
DAS Trader hotkey generator
"""
das-hotkey-generator
~~~~~~~~~~~~~~~~~~~~
If you came across this and have no idea what it is, read the article I
wrote here: https://forums.bearbulltraders.com/topic/518-position-sizing
on position sizing, and how I manage my risk.
INTRO
=====
@jherax
jherax / configure.md
Last active July 3, 2025 12:33
VS Code: Debugging with Jest

VS Code: Debugging Jest

Sometimes, debugging with console.log is not enough to find out what is happening in the code, as console.log prints only plain objects but neither functions nor objects with circular references. Besides, it's possible you may need to know the context and flow of the code.

Read more about debugging with VS Code in VS Code: Debugging.

@swyxio
swyxio / 1.md
Last active September 7, 2025 18:44
Learn In Public - 7 opinions for your tech career

2019 update: this essay has been updated on my personal site, together with a followup on how to get started

2020 update: I'm now writing a book with updated versions of all these essays and 35 other chapters!!!!

1. Learn in public

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos

@stramel
stramel / HOWTO.md
Last active July 19, 2025 13:33
Installing Powerline fonts on Windows 10

Installing Powerline fonts on Windows 10

Steps

  1. Download and extract zip from here
  2. Press Windows + x
  3. Press a (Selects PowerShell (Admin))
  4. Navigate to directory where fonts were extracted to (cd ${HOME}\Downloads\fonts-master\fonts-master)
  5. Set Execution Policy Set-ExecutionPolicy RemoteSigned [1]
  6. Press y then Enter to accept
@zorrodg
zorrodg / LICENSE
Last active November 30, 2023 19:37
CLI Integration Test Helper
MIT License
Copyright © 2019 Andrés Zorro
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: