Skip to content

Instantly share code, notes, and snippets.

View gary149's full-sized avatar

Victor Muštar gary149

View GitHub Profile
@antirez
antirez / codex_skill.md
Last active August 23, 2026 08:18
CLAUDE_CODEX_SKILL.md
name codex
description Use OpenAI Codex CLI for complex debugging, code analysis, or when stuck on difficult problems. Invokes Codex with a file-based question/answer pattern.
disable-model-invocation true

Using Codex for Complex Debugging

When you encounter a difficult problem that would benefit from a second perspective or deep analysis, use Codex via the file-based pattern.

@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active March 31, 2026 08:26
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@rikschennink
rikschennink / nudgeable.ts
Last active October 22, 2023 05:53
⌨️ A Svelte action to add arrow key interaction to an element
export default (element: HTMLElement, options: any = {}) => {
// if added as action on non focusable element you should add tabindex=0 attribute
const {
direction = undefined,
shiftMultiplier = 10,
bubbles = false,
stopKeydownPropagation = true,
} = options;
@rjcorwin
rjcorwin / my-counter.js
Created July 17, 2020 18:32
Basic web component example
class MyCounter extends HTMLElement {
constructor() {
super();
this.count = 0;
}
render() {
this.innerHTML = `
<style>
import * as React from "react";
import * as Vue from "vue/dist/vue";
import VueElement from "./VueElement";
import { PropertyControls, ControlType } from "framer";
// Define type of property
interface Props {
text: string;
}
@steven2358
steven2358 / ffmpeg.md
Last active August 22, 2026 23:51
FFmpeg cheat sheet
@shospodarets
shospodarets / Chrome headless Puppeteer- capture DOM element screenshot using
Last active June 21, 2026 12:54
Chrome headless Puppeteer- capture DOM element screenshot using
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Adjustments particular to this page to ensure we hit desktop breakpoint.
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1});
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'});
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@shprink
shprink / Ionic, scope CSS by state
Created February 16, 2016 16:42
Allow modifying any element by state and avoid CSS leaking
// JS
$rootScope.$on('$stateChangeSuccess', (event, toState, toParams, fromState, fromParams) => {
// Add a timeout for ionic transitions
// For 500ms we will have both module classes
// so both modules will have the right css
// when transitionned we remove the previous module class
clearTimeout(stateChangeTimeout);
stateChangeTimeout = setTimeout(() => {
$document.find('html').removeClass(`${_.kebabCase(fromState.class || fromState.name)}`);
}, 500);
@kengz
kengz / Deploying NodeJS App on Google Cloud Platform
Last active June 19, 2025 19:41
Deploying NodeJS App on Google Cloud Platform
# Deploying NodeJS App on Google Cloud Platform
`authored Jul 3 2015 by kengz`
## Installation
- Account with Google Cloud Platform.
- Install [Google Cloud Platform SDK](https://cloud.google.com/sdk/) to use `cloud` in the terminal.
- Install [Docker](https://cloud.google.com/tutorials/install-docker) for the VM container.
- Locally, login for the first time: `gcloud auth login`