Skip to content

Instantly share code, notes, and snippets.

View mogarick's full-sized avatar

Ricardo Montoya mogarick

View GitHub Profile

Add an "overnight mode" Stop hook to this repository for Claude Code. ​ Goal: when overnight mode is on, an unattended agent must never end its turn by asking a human a question. If its final message asks one, the hook blocks the stop and tells it to pick the most reasonable (based on what it knows about the project, task, and my preferences) reversible option and keep working. After two blocks in one session it lets the stop through, so a truly stuck agent can still finish. ​ Overnight mode is on only while the file ~/.agents/OVERNIGHT exists. I create it before leaving and delete it in the morning. ​ Steps:

  1. Create Tools/hooks/guard_overnight_questions.py with exactly the script below (adjust the wording of MESSAGE only if I ask).
  2. Register it in .claude/settings.json under hooks.Stop. Merge into any existing hooks; do not overwrite other entries. Use this entry: {"hooks": [{"type": "command", "command": "python3 "${CLAUDE_PROJECT_DIR}/Tools/hooks/guard_overnight_questions.py""}]}
@jesstelford
jesstelford / 01-shape-up-to-kindle.md
Last active August 11, 2026 19:43
Read SHAPE UP by basecamp on a Kindle / reMarkable / eReader

Read Shape Up by basecamp on a kindle / reMarkable / eReader

Basecamp's new book Shape Up is now available online (https://basecamp.com/shapeup) to read page-by-page.

There is a .pdf version, but that's not the best format for Kindle / other eReaders. Instead, we can convert the page-by-page into an eReader friendly format.

Part 1: Convert to a single page

NOTE: This has only been tested on Chrome

@MoOx
MoOx / index.web.js
Last active January 7, 2019 16:36
react-native-web partial Picker implementation (using react-native-web@0.0.44) https://github.com/necolas/react-native-web/issues/195
// @flow
// partial dirty implementation of react-native Picker
// should match http://facebook.github.io/react-native/docs/picker.html
// https://github.com/necolas/react-native-web/issues/184
import createDOMElement from "react-native-web/dist/modules/createDOMElement"
import PickerItem from "./item.web.js"
@mogarick
mogarick / queryLogLaravelEloquent.php
Last active January 18, 2017 18:36
Log de queries generadas por Laravel Eloquent
<?php
// Display all SQL executed in Eloquent
//source: http://laravel-tricks.com/tricks/display-all-sql-executed-in-eloquent
Event::listen('illuminate.query', function($query){Log::debug($query);});

Cheat sheet for callable entities in ES6

Value:

FD FE AF C M
Function-callable ✓ ✓ ✓ × ✓
Constructor-callable ✓ ✓ × ✓ ×
Prototype F.p F.p F.p SC F.p
Property prototype ✓ ✓ × ✓ ×
@bobbygrace
bobbygrace / trello-css-guide.md
Last active August 15, 2026 15:33
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@antonmedv
antonmedv / DotNotation.php
Last active August 11, 2022 13:47
Dot notation for access multidimensional arrays.
<?php
/**
* Dot notation for access multidimensional arrays.
*
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]);
*
* $value = $dn->get('bar.baz.foo'); // $value == true
*
* $dn->set('bar.baz.foo', false); // ['foo'=>false]
*
@nicerobot
nicerobot / README.md
Last active November 10, 2025 09:52
Mac OS X uninstall script for packaged install of node.js from https://stackoverflow.com/a/9287292/23056

To run this, you can try:

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
var fromBase64 = function(str) {
return (new Buffer(str || "", "base64")).toString("ascii");
};