Skip to content

Instantly share code, notes, and snippets.

@fj
fj / cf-api-pagination.sh
Created Sep 12, 2019
Paginate the CF API.
View cf-api-pagination.sh
#!/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 Jul 17, 2018
pipeline-with-manual-intervention.yml
View 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 Jul 8, 2018
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.
View tasks.json
{
// 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
a pairing interview for Recurse
View Gemfile
source "https://rubygems.org"
ruby "2.5.0"
gem "paint"
View postgres-10.sql
-- 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 Jul 2, 2017
reference example of the not-particularly-semantic HTML currently in place
View example-fragment.html
<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
Compares two YAML files and shows which keys are "missing" and which keys are "extras"
View compare.rb
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
View example.txt
#####################################
# 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 Jan 24, 2016
letter I received from a new developer
View letter-from-new-developer.md

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.😁

View Dockerfile
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"]