Instantly share code, notes, and snippets.
- Eindhoven, The Netherlands
- http://twitter.com/marckohlbrugge
- https://wip.co/@marc
This style guide was generated byClaude Code through deep analysis of theFizzy codebase - 37signals' open-source project management tool.
Why Fizzy matters: While 37signals has long advocated for "vanilla Rails" and opinionated software design, their production codebases (Basecamp, HEY, etc.) have historically been closed source. Fizzy changes that. For the first time, developers can study a real 37signals/DHH-style Rails application - not just blog posts and conference talks, but actual production code with all its patterns, trade-offs, and deliberate omissions.
How this was created: Claude Code analyzed the entire codebase - routes, controllers, models, concerns, views, JavaScript, CSS, tests, and configuration. The goal was to extract not justwhat patterns are used, butwhy - inferring philosophy from implementation choices.
| # Add these gems to your Gemfile | |
| gem"rails"# not strictly needed, but I use ActiveConcern, etc | |
| gem"raix"# helpful gem to reduce code needed for function calling etc | |
| gem"thor"# to make a CLI app (not needed if you make a web app) | |
| gem"http"# my preferred gem to make API calls | |
| # This is the main app (`app/models/ai_chat/cli.rb`) | |
| moduleAIChat | |
| classCli | |
| # Thor |
| require"thor" | |
| require"raix" | |
| moduleAIChat | |
| classCli <Thor | |
| desc"chat","Start a chat session with AI" | |
| defchat | |
| client=Client.new( | |
| user_interaction:->(message,type::prompt){ | |
| casetype |
| require'omniauth-oauth2' | |
| require'openssl' | |
| require'jwt' | |
| require'securerandom' | |
| moduleOmniAuth | |
| moduleStrategies | |
| classBluesky <OmniAuth::Strategies::OAuth2 | |
| option:name,'bluesky' | |
| require'http' | |
| require'json' | |
| require'terminal-table' | |
| users=[ | |
| {username:"marckohlbrugge"} | |
| ] | |
| # Fetch data for each user |
| exportdefault{ | |
| asyncfetch(request,env,ctx){ | |
| consturl=newURL(request.url); | |
| // Modify the request to point to the Google Tag Manager endpoint | |
| url.hostname=env.GTM_HOST; | |
| // Create a new headers object based on the original request headers | |
| constmodifiedHeaders=newHeaders(request.headers); |
Welcome! This guide will help you add the WIP Streaks widget to your home screen using the Scriptable app. This widget shows your streak and how many hours you have left to complete a todo if you haven't completed any today yet.
Before you begin, make sure you have:
- TheScriptable app installed on your device.
- An API key fromWIP.
| // Replace with your API key from https://wip.co/my/api_keys | |
| constAPI_KEY="wip_sk_FOOBAR"; | |
| constAPI_URL=`https://api.wip.co/v1/users/me.json?api_key=${API_KEY}`; | |
| // Function to fetch data from the API | |
| asyncfunctionfetchStreakData(){ | |
| if(API_KEY==="wip_sk_FOOBAR"){ | |
| letalert=newAlert(); | |
| alert.title="API Key Missing"; | |
| alert.message="Please replace the placeholder API key with your actual API key."; |
| { | |
| "always_run_in_app" : false, | |
| "icon" : { | |
| "color" : "yellow", | |
| "glyph" : "fire" | |
| }, | |
| "name" : "WIP Streak", | |
| "script" : "\/\/ Replace with your API key\nconst API_KEY = \"wip_sk_REPLACE_ME\";\nconst API_URL = `https:\/\/api.wip.co\/v1\/users\/me.json?api_key=${API_KEY}`;\n\n\/\/ Function to fetch data from the API\nasync function fetchStreakData() {\n let request = new Request(API_URL);\n let response = await request.loadJSON();\n return response;\n}\n\n\/\/ Function to calculate hours left until midnight in a given time zone\nfunction hoursLeftUntilMidnight(timeZone) {\n let now = new Date();\n let nowInUserTimeZone = new Date(now.toLocaleString(\"en-US\", { timeZone: timeZone }));\n let midnight = new Date(nowInUserTimeZone);\n midnight.setHours(24, 0, 0, 0); \/\/ Set to midnight\n\n let hoursLeft = (midnight - nowInUserTimeZone) \/ (1000 * 60 * 60); \/\/ Convert milliseconds to hours\n return hoursLeft.toFixed(0);\n}\n\n\/\/ Function to create a widget displaying the streak info\nasy |
| <?php | |
| // Get your API key here: https://wip.co/my/api_keys | |
| $apiKey ='wip_sk_FOOBAR'; | |
| $baseUrl ='https://api.wip.co/v1'; | |
| $projectSlug ='nomadlist'; | |
| // Get todos for the project with pagination | |
| $limit =10; | |
| $startingAfter =isset($_GET['starting_after']) ?$_GET['starting_after'] :null; |