Skip to content

Instantly share code, notes, and snippets.

View dboskovic's full-sized avatar
🥸
Getting nerdy

David Boskovic dboskovic

🥸
Getting nerdy
View GitHub Profile
import { FlatfileEvent, FlatfileListener } from "@flatfile/listener";
import { Flatfile } from "@flatfile/api";
/**
* Reaction plugin for Flatfile.
*
* @param options
* @param callback
*/
export function streamData<T extends StreamActionOptions>(
@dboskovic
dboskovic / flatfile-api.d.ts
Created June 5, 2023 19:30
flatfile-api.d.ts
// Generated by dts-bundle v0.7.3
// Dependencies for this module:
// ../stream
// ../@ungap/url-search-params
// ../axios
declare module '@flatfile/api' {
import { FlatfileClient } from "@flatfile/api/wrapper/FlatfileClient";
export * as Flatfile from "@flatfile/api/api";
export { FlatfileClient } from "@flatfile/api/wrapper/FlatfileClient";
@dboskovic
dboskovic / _readme.md
Last active April 10, 2019 17:56
KeystoneJS: Cloudinary Cache => Amazon S3

I had a client who I built a site for (ecommerce) that had a lot of high resolution images. (running about 500gb/mo). Cloudinary charges $500/mo for this usage and Amazon charges about $40. I wrote some middleware that I used to wrap my cloudinary urls with in order to enable caching. This is entirely transparent and still enables you to use all the cool cloudinary effect and resizing functions. Hopefully this is useful to someone!

I think using deasync() here is janky but I couldn't think of another way to do it that allowed for quite as easy a fix.

<?php
namespace Bundles\API;
use Exception;
use bundles\SQL\ListObj;
use e;
class Expression {
private static $comparison = array('gt' => '>','min' => '>=','max' => '<=','gte' => '>=','in' => '?','lt' => '<','lte' => '<=','ne' => '!=','nin' => '?','range' => '?','eq' => '=','contains' => '?');

Keybase proof

I hereby claim:

  • I am dboskovic on github.
  • I am dboskovic (https://keybase.io/dboskovic) on keybase.
  • I have a public key whose fingerprint is 5C13 F5EC 1F07 4E47 55DC E474 5F34 D0E1 B0C5 DF60

To claim this, I am signing this object:

var EnvoyPlatform = require('envoy-platform');
var plugin = new EnvoyPlatform;
plugin.route('hello-world', function(req, res){
res.view('hello-world.html');
});
<?php
namespace Bundles\CSV;
ini_set('auto_detect_line_endings', 1);
use Exception;
use e;
/**
* CSV File Parser
*
@dboskovic
dboskovic / gist:3825776
Created October 3, 2012 08:21 — forked from vxnick/gist:380904
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',