Skip to content

Instantly share code, notes, and snippets.

@karljuhlpep
karljuhlpep / dspy_codegen.py
Last active April 19, 2024 22:35
DSPy Module - CodeGen + Debugging
import subprocess
import dspy
### Note this code is not tested, and likely includes errors that need to be refined.
class IterativeCodeRefinement(dspy.Module):
def __init__(self):
super().__init__()
self.generate_pseudocode = dspy.ChainOfThought("task -> pseudocode")
@qrtt1
qrtt1 / build.gradle
Created May 23, 2016 04:27
Gradle files(), fileTree()
//
// Demo Structure
//
// qty:lab qrtt1$ tree
// .
// ├── build.gradle
// └── libs
// ├── a.jar
// └── vendorA
@R1j1t
R1j1t / pre-commit
Last active April 19, 2024 22:32
Pre-commit hook for python repo: Instead of getting to know whether any lint checks failed in CI, I created this pre-commit hook in git for my python repo. Git Hooks is a powerful utility. You read from the official documentation: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks. Please ⭑ this Gist if you find it useful! Feel free to co…
#!/bin/sh
# This is a pre-commit hook for python. It checks if black is passed and then if flake8 is passed.
# Feel free to share your updates. It will help use these git feature!
if black . --check; then
echo "Everything is all right in black"
else
echo ""
@onlurking
onlurking / programming-as-theory-building.md
Last active April 19, 2024 22:31
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@kettanaito
kettanaito / App.jsx
Created May 27, 2020 06:33
CSS Variables in Styled Components
import { createGlobalStyle, css } from 'styled-components'
const GlobalStyle = createGlobalStyle`
html {
/* Maps all colors from the `theme` to CSS variables: */
${({ theme }) => Object.entries(theme.colors).map(([name, value]) => css`
--${camelCaseToKebabCase(name)}: ${value};
`)}
}
`
@brockelmore
brockelmore / bedrock_deploy.sol
Last active April 19, 2024 22:28
Optimism-Bedrock deployment with foundry
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.15;
import "forge-std/Script.sol";
// L1
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
import { L1ERC721Bridge } from "../L1/L1ERC721Bridge.sol";
import { L1StandardBridge } from "../L1/L1StandardBridge.sol";
import { L2OutputOracle } from "../L1/L2OutputOracle.sol";
@tuxPT
tuxPT / sway-config
Last active April 19, 2024 22:17
sway config
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
exec wal -R
#notifications
exec mako
exec mailnag
@incogbyte
incogbyte / mixunpin.js
Last active April 19, 2024 22:17
Frida script to bypass common methods of sslpining Android
console.log("[*] SSL Pinning Bypasses");
console.log(`[*] Your frida version: ${Frida.version}`);
console.log(`[*] Your script runtime: ${Script.runtime}`);
/**
* by incogbyte
* Common functions
* thx apkunpacker, NVISOsecurity, TheDauntless
* Remember that sslpinning can be custom, and sometimes u need to reversing using ghidra,IDA or something like that.
* !!! THIS SCRIPT IS NOT A SILVER BULLET !!
@fishchev
fishchev / index.html
Last active April 19, 2024 22:15
Minimal page structure/sample to trigger Telegram's IV template for https://teletype.in.
<!DOCTYPE html>
<head>
<title>$title</title>
<meta property="og:site_name" content="$site_name">
<meta property="og:description" content="$description">
<meta property="article:author" content="$author">
<!-- $image_url / link preview image is set using og:image property -->
<!-- <meta property="og:image" content="http://example.com/img.jpeg"> -->
<meta property="telegram:channel" content="@cor_bee">