Skip to content

Instantly share code, notes, and snippets.

@disler
disler / README.md
Last active April 20, 2025 23:33
Use Meta Prompting to rapidly generate results in the GenAI Age

Meta Prompting

In the Generative AI Age your ability to generate prompts is your ability to generate results.

Guide

Claude 3.5 Sonnet and o1 series models are recommended for meta prompting.

Replace {{user-input}} with your own input to generate prompts.

Use mp_*.txt as example user-inputs to see how to generate high quality prompts.

@probonopd
probonopd / Wayland.md
Last active April 25, 2025 00:10
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.


As 2024 is winding down:

#!/bin/bash
#set persistence mode for all GPU
sudo nvidia-smi -pm 1
#Set gpu max power at 160w
sudo nvidia-smi -pl 160
#Set Power level of specific GPU (1080) in watts
# sudo nvidia-smi -i 2 -pl 200
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 8, 2025 14:18
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;
}
@dermesser
dermesser / libfcgi-example.c
Created July 3, 2014 11:14
In case anyone wants to see a multi-threaded FastCGI application written with the fcgiapp library.
# include <stdlib.h>
# include <stdio.h>
# include <sys/stat.h>
# include <pthread.h>
# include <fcgiapp.h>
const char* const sockpath = "/tmp/fcgicpp.sock";
@dergachev
dergachev / _msaccess_from_php.md
Last active May 17, 2018 17:11
Figuring out how to talk to MS Access from PHP

Installation

Downloaded Windows XP / IE8 image from http://www.modern.ie/en-us/virtualization-tools

curl -O "https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/OSX/IE8_XP/IE8.XP.For.MacVirtualBox.ova"
  • Virtualbox -> Import > "IE8.XP.For.MacVirtualBox.ova"
@schlamar
schlamar / gist:7024668
Created October 17, 2013 13:14
Handle Windows privileges from Python. Based on http://stackoverflow.com/a/2129589/851737
from __future__ import print_function
import ctypes
from ctypes import wintypes
GetCurrentProcess = ctypes.windll.kernel32.GetCurrentProcess
GetCurrentProcess.restype = wintypes.HANDLE
OpenProcessToken = ctypes.windll.advapi32.OpenProcessToken
OpenProcessToken.argtypes = (wintypes.HANDLE, wintypes.DWORD, ctypes.POINTER(wintypes.HANDLE))
OpenProcessToken.restype = wintypes.BOOL
@Xophmeister
Xophmeister / long2ip.sql
Last active September 24, 2022 23:46
Oracle SQL and PL/SQL function to convert proper IPv4 address (i.e., 32-bit integer) into the standard, "dotted" format
-- We have a table (ip_log) of proper IPv4 addresses (ip)
select bitand(ip / 16777216, 255) || '.' || bitand(ip / 65536, 255) || '.' || bitand(ip / 256, 255) || '.' || bitand(ip, 255) ip
from ip_log;
-- ...or a function to do the same:
create or replace function long2ip(ip in number)
return varchar2 deterministic
as
begin
return bitand(ip / 16777216, 255) || '.' ||
@xcommerce-gists
xcommerce-gists / CreateAccount
Last active December 25, 2015 12:21
How to Create a PayPal Account Using Adaptive Accounts.curl
HTTP Headers
------------
-H "X-PAYPAL-SECURITY-USERID: <Caller-UID>" # UserID from the Caller account
-H "X-PAYPAL-SECURITY-PASSWORD: <Caller-Pswd>" # Password from the Caller account
-H "X-PAYPAL-SECURITY-SIGNATURE: <Caller-Sig>" # Signature from the Caller account
-H "X-PAYPAL-REQUEST-DATA-FORMAT: JSON"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: JSON"
-H "X-PAYPAL-SANDBOX-EMAIL-ADDRESS: <Caller-Sandbox-edress>"
-H "X-PAYPAL-DEVICE-IPADDRESS: 192.0.2.0"
-H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" # Standard Sandbox App ID