Skip to content

Instantly share code, notes, and snippets.

View olegp's full-sized avatar

Oleg Podsechin olegp

View GitHub Profile
@olegp
olegp / clean.md
Created October 15, 2026 04:53
Simplified clean, reflect and wrap skills from the Out of Context talk, 2026-10-14. Save each as .claude/skills/<name>/SKILL.md
name clean
description Prune notes and specs that no longer earn their place

Stale Markdown misleads the agent more than missing Markdown does. Run this now and then to drop what no longer holds.

  1. List the notes, specs and plans under docs/ that nothing links to and no open task points at
{
"event": {
"date": "23/10/2025",
"link": "https://docs.google.com/forms/d/e/1FAIpQLScf_uZ2-EPOGMoF4sczwVNHnktpBqQQ3YWX68l3ctPwzqA-Vg/viewform"
},
"members": 102
}
{
"event": {
"date": "16/08/2026",
"link": "https://docs.google.com/forms/d/e/1FAIpQLSc6ytLNahJeiMaJp6hL7y94cvJC7MSfgvrJmVwYUgxqMkp-vw/viewform"
},
"members": 32
}
@olegp
olegp / background.js
Created September 20, 2018 20:31
Active tab change detection in Chrome Extension
let activeTabId, lastUrl, lastTitle;
function getTabInfo(tabId) {
chrome.tabs.get(tabId, function(tab) {
if(lastUrl != tab.url || lastTitle != tab.title)
console.log(lastUrl = tab.url, lastTitle = tab.title);
});
}
chrome.tabs.onActivated.addListener(function(activeInfo) {
@olegp
olegp / raffle.js
Last active March 20, 2018 17:43
((p) => p[Math.floor(Math.random() * (p.length))])(`
Alberto Marchetti
Daniel Schildt
Ekaterina Dorrer
Fernando Girón
Iines Piesala
Joonas Haaparanta
Majedul Hoque Ruman
Margarita Obraztsova
Matti Vakkilainen
<div>
<form ng-submit="submit()">
<input ng-model="text">
<button>Submit</button>
</form>
<ul>
<li ng-repeat="message in messages">{{message.time}} {{message.text}}</li>
</ul>
</div>
@olegp
olegp / placeholder.js
Created December 30, 2015 12:52
input placeholder shim
if (!('placeholder' in document.createElement('input'))) {
angular.module('directives').directive('placeholder', ['$timeout', function($timeout) {
return function($scope, $element, $attrs) {
var hasFocus = false;
$element.bind('focus', function() {
hasFocus = true;
if ($element.hasClass('placeholder')) {
$timeout(function() {
$element.val('');
$element.removeClass('placeholder');
@olegp
olegp / prettify.js
Last active December 29, 2015 10:26
JS code for generating SEO friendly URL fragments
function prettify(text) {
return text.toLowerCase()
.replace(/ä/g, 'a')
.replace(/ö/g, 'o')
.replace(/å/g, 'a')
.replace(/[^0-9a-z]+/g, '-')
.replace(/^-*(.*?)-*$/, '$1');
}
@olegp
olegp / test.js
Created December 15, 2014 20:32
test
module.exports = "test";
var express = require('express');
var app = express();
var messages = [
{ date: new Date(), text: "Hello World" }
];
app.use('/', express.static('./'));
app.get('/api/', function(req, res){