Skip to content

Instantly share code, notes, and snippets.

Avatar

David Boskovic dboskovic

View GitHub Profile
View expression.php
<?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' => '?');
View keybase.md

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:

View index.js
var EnvoyPlatform = require('envoy-platform');
var plugin = new EnvoyPlatform;
plugin.route('hello-world', function(req, res){
res.view('hello-world.html');
});
@dboskovic
dboskovic / _readme.md
Last active Apr 10, 2019
KeystoneJS: Cloudinary Cache => Amazon S3
View _readme.md

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.

View Snake-Timeline.markdown

Snake Timeline

This timeline is designed to be a short (usually only two rows) with the ability to add more items on the end. I haven't added any styling for a 3rd row yet, and the boxes have to be a fixed height. More iterations on this in the future!

A Pen by David Boskovic on CodePen.

License.

@dboskovic
dboskovic / autofill-ui-router.js
Created Feb 17, 2014
Integrate angular-ui/ui-router with tbosch/autofill-event
View autofill-ui-router.js
$rootScope.$on('$viewContentLoaded', function(){
$timeout(function(){
$('input').checkAndTriggerAutoFillEvent()
}, 200);
})
View csv.php
<?php
namespace Bundles\CSV;
ini_set('auto_detect_line_endings', 1);
use Exception;
use e;
/**
* CSV File Parser
*
@dboskovic
dboskovic / gist:3825776
Created Oct 3, 2012 — forked from vxnick/gist:380904
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
View gist:3825776
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',