Skip to content

Instantly share code, notes, and snippets.

@ctran
ctran / cursor-instruction.txt
Created March 21, 2025 16:07 — forked from jhartum/cursor-instruction.txt
Cline memory bank for Cursor instruction
# Cursor's Memory Bank
I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.
## Memory Bank Structure
The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:
```mermaid
flowchart TD
@ctran
ctran / config.yml
Created March 15, 2023 13:43 — forked from rwp0/config.yml
GH CLI Transfer Repository Ownership Alias
# ~/.config/gh/config.yml
# What protocol to use when performing git operations. Supported values: ssh, https
git_protocol: https
# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.
editor:
# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled
prompt: enabled
# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager.
pager:
@ctran
ctran / README.md
Last active April 27, 2023 03:17
Run curl with some timing

This can be run with

bash <(https://gist.githubusercontent.com/ctran/3f0d681a1ae12622f4f397cbfeac3750/raw/ea4a47fdb7f0e56009f4265c231fe22035effffe/curltime) url

or

curl -s https://gist.githubusercontent.com/ctran/3f0d681a1ae12622f4f397cbfeac3750/raw/ea4a47fdb7f0e56009f4265c231fe22035effffe/curltime) | bash -s url
#!/bin/bash
## The following is automatically generated code, do not manually modify.
## Template is available in # scripts/commons-templates.sh
## START AUTOGENERATED CODE
# shellcheck disable=SC2034
SCRIPT_VERSION=1630078691
# Useful variables
@ctran
ctran / filesize.groovy
Last active October 14, 2020 19:07
filesize to human
// Convert a number of bytes to a more readable string
// Written this way (with attrs), as I was using it for a Grails taglib
def filesize = {
attrs ->labels = [' bytes', 'KB', 'MB', 'GB', 'TB']
size = attrs.size
label = labels.find {
if (size < 1024) {
true
}
else {
# Reset
Color_Off='\033[0m' # Text Reset
# Regular Colors
Black='\033[0;30m' # Black
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Blue='\033[0;34m' # Blue
Purple='\033[0;35m' # Purple
@ctran
ctran / README.md
Created May 31, 2019 22:14 — forked from twolfson/README.md
Setting up SOPS

I'm learning about SOPS and setting it up as my preferred mechanism for storing secrets. Here are my notes.

PGP

It’s security mechanism is that we (i.e. client) use a PUBLIC key from the receiver (i.e. server) and encode it with a random key (I’m saying nonce but it could be reused)

This varies from RSA and SSH because the server uses a PUBLIC key to identify the client.

Web of trust

Web of trust operates by still using PGP (i.e. encoding with recipient’s public key) but additionally, we can encrypt/sign the data as our own by signing it with the client’s private key.

This means the recipient will initially decrypt via our (i.e. client’s) public key (verifying the source) and then decrypting via their (i.e. server’s) private key to get the data.

pipeline {
agent none
options {
buildDiscarder logRotator(numToKeepStr: '10')
}
triggers {
eventTrigger jmespathQuery("repository.full_name")
@ctran
ctran / multi_brach_dsl_with_custom_strategy_and_script_path.groovy Jenkins Job DSL for a Multi-Branch Pipeline that includes Branch Source Strategy & custom Jenkinsfile script path
UUID uuid = UUID.randomUUID()
multibranchPipelineJob("my_awesome_job") {
displayName "my awesome job"
description "multi-branch pipeline job thingy"
configure {
it / sources / 'data' / 'jenkins.branch.BranchSource' << {
source(class: 'jenkins.plugins.git.GitSCMSource') {
id(uuid)
remote("git@gitlab:root/repo.git")
@ctran
ctran / pipeline.groovy
Created April 27, 2018 06:37 — forked from paulchubatyy/pipeline.groovy
Jenkins pipeline to read the repository list for Github Organization and create multibranch pipeline projects for them
import org.kohsuke.github.*
/*
* This pipeline uses the Jenkins Job DSL plugin to create the multi-branch pipelines
* for your Github Organization repositories.
*
* @see https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
*
* It does not consumes 5k requests in 6 minutes, but actually queries the Github API
* for the repositories in organization and creates the Multi-Branch Pipelines in Jenkins.