Skip to content

Instantly share code, notes, and snippets.

View znck's full-sized avatar
🎯
Focusing

Rahul Kadyan znck

🎯
Focusing
View GitHub Profile
@znck
znck / default.md
Created July 9, 2025 04:54 — forked from cablej/default.md
Cluely System prompt

<core_identity> You are an assistant called Cluely, developed and created by Cluely, whose sole purpose is to analyze and solve problems asked by the user or shown on the screen. Your responses must be specific, accurate, and actionable. </core_identity>

<general_guidelines>

  • NEVER use meta-phrases (e.g., "let me help you", "I can see that").
  • NEVER summarize unless explicitly requested.
  • NEVER provide unsolicited advice.
  • NEVER refer to "screenshot" or "image" - refer to it as "the screen" if needed.
  • ALWAYS be specific, detailed, and accurate.
@znck
znck / Example.vue
Created January 1, 2021 02:23
Preview API Example
<preview>
<setup
:requests="{
// Mock requests
'/api/repos': $p.repeat(10, id => ({ id })),
'/api/repos/:id': id => $p.x.getUser(id),
'/api/repos/znck0': $p.http.status(404),
}"
:components="{
@znck
znck / reactivity.js
Created October 14, 2020 14:34
A simple re-implementation of Vue's reactivity system
/** @type {WeakMap<object, Map<any, Set<Function>>>} */
const targetMap = new WeakMap()
let activeEffect = undefined
let shouldTrack = true
const effectStack = []
const trackStack = []
/**
* @param {object} target
@znck
znck / format.swift
Last active September 8, 2020 09:00
Format VS Code copied code snippet
import Cocoa
let pasteboard = NSPasteboard.general
let re1 = try! NSRegularExpression(pattern: "background-color:.*?;")
let re2 = try! NSRegularExpression(pattern: "font-size:.*?;")
let re3 = try! NSRegularExpression(pattern: "font-family:.*?;")
let htmlType = NSPasteboard.PasteboardType(rawValue: "public.html")
@znck
znck / shimmer.css
Last active August 13, 2020 17:21
CSS only shimmer
@keyframes placeHolderShimmer {
0% {
background-position: -80px 0;
}
100% {
background-position: 640px 0;
}
}
@znck
znck / array.ts
Created January 27, 2020 10:12
Array.prototype.forEachNonBlocking
export async function forEachNonBlocking<T>(
arrayOrIterator: IterableIterator<T> | T[],
fn: (item: T) => void,
frameBudgetInMillis: number = 10
): Promise<void> {
const iterator = Array.isArray(arrayOrIterator)
? arrayOrIterator[Symbol.iterator]()
: arrayOrIterator;
return new Promise((resolve, reject) => {
@znck
znck / promised.ts
Last active August 14, 2019 15:22
Moved to https://github.com/znck/promised | A utility to convert callbacks to promises.
import {promisify, CustomPromisify} from 'util'
export type FunctionProxy<T extends Function> = CustomPromisify<T>
export type PackageProxy<P extends { [key: string]: Function }> = {
[K in keyof P]: FunctionProxy<P[K]>
}
export function promised<T extends { [key: string]: Function | any }>(target: T): PackageProxy<T> {
@znck
znck / begin-again.md
Last active January 29, 2019 13:13
VueBLR - Begin Again Workshop

# Initial Commit

# Create new npm project

  • Create new project
    npm init
import { mount } from 'vue-test-utils'
import { createRenderer } from 'vue-server-renderer'
import MyComponent from './MyComponent.vue'
const renderer = createRenderer()
renderer.renderToString(
mount(MyComponent).vm,
(error, html) => {
@znck
znck / Hello.vue
Last active October 29, 2017 14:16
vue component compiler source map issue
<template>
<h2 class="red">{{msg}}</h2>
</template>
<script>
export default {
data () {
return {
msg: 'Hello from Component A!'
}