Skip to content

Instantly share code, notes, and snippets.

View danphilibin's full-sized avatar

Dan Philibin danphilibin

View GitHub Profile
@danphilibin
danphilibin / interval-aider-demo.md
Created August 7, 2023 16:56
Chat transcript from demo of using Aider (https://aider.chat) and Interval (https://interval.com) to build internal tools.

Aider v0.8.3
/Users/dan/.pyenv/versions/3.10.9/bin/aider DOCS.md src/index.ts src/utils/db.ts src/utils/stripe.ts prisma/schema.prisma
Model: gpt-4
Git repo: .git
Repo-map: universal-ctags using 1024 tokens
Added DOCS.md to the chat.
Added prisma/schema.prisma to the chat.
Added src/index.ts to the chat.
Added src/utils/db.ts to the chat.
Added src/utils/stripe.ts to the chat.

import { T_IO_STATE } from '@interval/sdk/dist/ioSchema'
export default class CursorPagination {
cursors: string[] = []
lastOffset: number = 0
lastQueryTerm: string | undefined
lastSortColumn: string | undefined
lastSortDirection: string | undefined
update(newState: T_IO_STATE<'DISPLAY_TABLE'>) {
@danphilibin
danphilibin / .htaccess
Created March 27, 2018 01:30 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
{
"refreshPaths": [
"/",
"/quote-pictures/",
"/pages/",
"/posts/",
"/latest/",
"/quotes/tv/",
"/quotes/tv/page/2/",
"/quotes/tv/page/3/",
<?php hello
@danphilibin
danphilibin / gist:2042048
Created March 15, 2012 05:10
WordPress post view counter
// update view count for a post
function update_post_views($postID=0) {
$view_count = get_post_meta($postID, '_view_count', true);
if(!$view_count) $view_count = 0;
update_post_meta($postID, '_view_count', $view_count+1);
}
// usage within loop:
<?php update_post_views($post->ID); ?>
@danphilibin
danphilibin / button_shortcode.php
Created February 20, 2012 00:50
WordPress button shortcode
<?php
function button_shortcode($atts, $content = null) {
extract(shortcode_atts(array('link' => '#'), $atts));
return '<p class="clearfix"><a class="button" href="'.$link.'">' . do_shortcode($content) . '</a></p>';
}
add_shortcode('button', 'button_shortcode');
?>
<div id="feature_slider">
<div class="slide" id="slide-1">
<div class="header_item"></div>
<img>
</div>
<div class="slide" id="slide-2">
<div class="header_item"></div>
<img>
</div>
<div class="slide" id="slide-3">