Skip to content

Instantly share code, notes, and snippets.

View tmilewski's full-sized avatar
👋

Tom Milewski tmilewski

👋
View GitHub Profile
@tmilewski
tmilewski / 0-usage.ts
Created March 8, 2023 18:09
Quick and dirty pseudo-code for a typed search (Algolia) index
import { SearchIndex } from './search-index.ts'
import { SearchService } from './search-service.ts'
// ==========================================================
// Index Contents Shape
// ==========================================================
export interface Collab {
id: string
name: string
@tmilewski
tmilewski / alias.symlink
Created March 11, 2020 18:32
New git aliases
@tmilewski
tmilewski / formstack-embed-using-postscribe.html
Created April 29, 2019 20:05 — forked from matt-bailey/formstack-embed-using-postscribe.html
Embed a Formstack form asynchronously, using Postscribe
// https://github.com/krux/postscribe
<!-- Main form wrapper, required for styling the form -->
<div class="webform">
<!-- Empty div (must have a unique ID), into which the form will be loaded -->
<div id="formstack-bridal-appointment"></div>
<script type="text/javascript">// <![CDATA[
// Only run the code below when jQuery says the document is ready
(function($) {
// Process the form using postscribe:
// 1. Must reference the unique ID of the div above
#!/usr/bin/env ruby
# > TOKEN=[PERSONAL ACCESS TOKEN] ruby backup.rb
require 'octokit'
directory = './backups'
client = Octokit::Client.new(
access_token: ENV['TOKEN'],

Giphy WEBP Converter

giphy [mp4 gif url]

Install

  • Copy and run the following:
curl -o /usr/local/bin/giphy https://gist.githubusercontent.com/tmilewski/f65dd9b6bfcf5c2a39742ce1e515a481/raw/3baa4e5ecdc5d07bd3948d406360e90d8223aa90/giphy; chmod +x /usr/local/bin/giphy
@tmilewski
tmilewski / powssl
Last active August 29, 2015 14:06 — forked from paulnicholson/powssl

Instructions

  • Install stud $ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
  • Download and install the powssl script $ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl $ chmod +x ~/bin/powssl
  • Run powssl to create development certificate and configure stud.
  • $ powssl
@tmilewski
tmilewski / gist:11407741
Last active August 29, 2015 14:00
HTTPS with POW
# Install stud
brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
# Download and install the powssl script
curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/3ea59efe8c7e9013c265313045a9fdda5c653963/powssl > ~/bin/powssl
chmod +x ~/bin/powssl
# Add ~/bin to your PATH
export PATH="$HOME/bin:$PATH"
#!/bin/sh
# Licence: MIT
# Created by tomykaira, 2011-10-25
if [ $# -ne 1 ]; then
echo "Give me your new project name (only)"
exit 1
fi
var sendParam = function(p) {
// sends a GET request, no jQuery or wrapper needed
(new Image).src = '/my_route?p='+encodeURIComponent(p);
}
@tmilewski
tmilewski / countdown.coffee
Created October 24, 2012 03:50
A Very Simple - Timezone Agnostic - Countdown Script.
class window.Countdown
constructor: (ends_at, custom_callbacks) ->
now = new Date
end = new Date(Number(ends_at) * 1000)
default_callbacks =
tick: ->
complete: ->
@callbacks = $.extend(default_callbacks, custom_callbacks)