Skip to content

Instantly share code, notes, and snippets.

@fj
fj / cf-api-pagination.sh
Created September 12, 2019 02:00
Paginate the CF API.
#!/bin/bash
set -e
# requires `jq`
function load_all_pages {
URL="$1"
DATA=""
until [ "$URL" == "null" ]; do
RESP=$(cf curl "$URL")
DATA+=$(echo "$RESP" | jq .resources)
@fj
fj / pipeline-with-manual-intervention.yml
Created July 17, 2018 15:30
pipeline-with-manual-intervention.yml
---
resources:
- name: my-resource
type: git
source:
branch: master
uri: https://github.com/pivotalservices/concourse-pipeline-samples.git
jobs:
- name: Run-automatically
@fj
fj / tasks.json
Created July 8, 2018 05:04
This is roughly the implicit `tasks.json` that would have been generated by the `rls-vscode` extension to work around the issue raised in issue #359.
{
// This is roughly the implicit `tasks.json` that would have been generated
// by the `rls-vscode` extension to work around the issue raised in issue #359.
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "cargo build",
"command": "cargo",
"args": [
@fj
fj / Gemfile
Last active May 5, 2018 20:38
a pairing interview for Recurse
source "https://rubygems.org"
ruby "2.5.0"
gem "paint"
-- full-text search in JSON/JSONB columns
CREATE INDEX transactions_fts ON transactions
USING gin (( to_tsvector('english', transactions) ))
-- parallelism now supported or improved in:
-- * bitmap heap scans
-- * merge joins
-- * btree index scans
-- partitioning
@fj
fj / example-fragment.html
Created July 2, 2017 16:44
reference example of the not-particularly-semantic HTML currently in place
<div class="measure--lg">
<div class="g">
<div class="g-r">
<section class="g-r-c-6-12 p1 mx1 home-list">
<div class="block">
<div class="list-meta-title">
recent entries
<a href="http://localhost:3000/entries/" class="list-meta-all" title="see all entries">see all</a>
</div>
<ul class="list">
@fj
fj / compare.rb
Created May 5, 2017 21:44
Compares two YAML files and shows which keys are "missing" and which keys are "extras"
require 'yaml'
class Hash
def fully_qualified_keys
map { |k,v|
v.fully_qualified_keys.map{ |a| "#{k}.#{a}" } rescue k.to_s
}.flatten
end
end
@fj
fj / example.txt
Last active April 30, 2016 17:09
#####################################
# recipes.html
---
layout: showcase
title: Recipes
description: my favorite recipes
---
{% assign item_collection = site.recipes | sort: 'date_range' %}
#####################################
@fj
fj / letter-from-new-developer.md
Last active January 24, 2016 17:34
letter I received from a new developer

Hi John,

I am {name redacted}, a 4th year student @ {university in India}.

I was looking up for list reversal problem in stackoverflow and came across your solution. I liked the solution a lot and went ahead and checked out your profile on SO. Then I visited your linkedin profile and then I realized you are totally experienced developer.

I read ur summary( really loved ur philosophy on design!! simply awesome) and went through all your contributions to the developer world. I also visited all ur github repos and saw ur open source contributions. I really liked ur project awesomesauce although my javascript skill is not that proficient to understand most of your code.😁

FROM alpine:latest
MAINTAINER John Feminella <jxf@jxf.me>
RUN apk add --update \
inotify-tools \
qemu-system-x86_64 \
&& rm -rf /var/cache/apk/*
COPY mysqld.bin run.sh fs/etc.iso fs/data.ffs /unikernel/
WORKDIR /unikernel
CMD ["/unikernel/run.sh"]