Skip to content

Instantly share code, notes, and snippets.

View bzitzow's full-sized avatar

Brian Zitzow bzitzow

  • BRIAN ZITZOW
  • Roseville, California
View GitHub Profile
@bzitzow
bzitzow / settings.json.md
Last active March 8, 2023 03:26
vscode format on save prettier
{
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
        "source.fixAll": true,
        "source.organizeImports": true,
    },
    "editor.defaultFormatter": "esbenp.prettier-vscode",
}
We couldn’t find that file to show.

AutoFill Spike

Browser Support

Given that each browser does autofill and auto complete differently, identify how each of our supported browsers determines:

  • Should this input be saved for later completion
  • Should this input be auto-filled
  • Input level
  • Form level
@bzitzow
bzitzow / promotion-api.md
Last active July 18, 2019 21:01
POST /checkout/carts/promotion.json
{ 
   "checkoutResponse":{ 
      "cart":{ 
         "id":"1",
         "items":[ 
            { 
               "id":"313fb143-3478-4a4c-b688-e3cb5dcdaa62",
               "catalog":"19",
               "sku":"4380192",
@bzitzow
bzitzow / phx-1.4-upgrade.md
Last active October 10, 2018 21:42 — forked from chrismccord/phx-1.4-upgrade.md
Phoenix 1.3.x to 1.4.0 Upgrade Guides

Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.

This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.

Update Phoenix and Cowboy deps

To get started, simply update your Phoenix dep in mix.exs:

{:phoenix, "~> 1.4.0-rc"}
@bzitzow
bzitzow / 0_readme.md
Created September 25, 2017 15:48 — forked from gakuzzzz/0_readme.md
MapStreamSyntax

Java8 の Stream で Map を操作するサポート作った

MapStreamSyntax というクラスで基本的に static import して使います。

具体例を見てもらえばどの辺が便利なのか伝わるでしょうか?

Case.1

// JDK標準APIのみ
public Map<Integer, String> Case1_Before(final Map<Integer, String> map) {
@bzitzow
bzitzow / gist:9056b9147698f171eb2d
Created May 23, 2014 22:26
Phonegap SQLite Database Schema Migrations
//phoneGap HTML5 SQLite database schema migration example
var db = null;
var current_migration = null;
var current_schema_version = null;
// keep migration version order
var db_migrations = {
v1: {
version: "1.0",
up: function(tx) {
@bzitzow
bzitzow / gist:8343680
Last active January 2, 2016 18:29 — forked from Mithrandir0x/gist:3639232
Differences between Factories, Services and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@bzitzow
bzitzow / gist:7652035
Created November 26, 2013 01:32
Android DPI Calculator # Source: http://coh.io/adpi/
<script>
$( function() {
function applyToInputSet( id ) {
var dpis = [ 320, 240, 160, 120, 212.8 ];
var labels = [ 'xhdpi', 'hdpi', 'mdpi', 'ldpi', 'tvdpi' ];
var inputs = $(id+' input');
inputs.each( function(i) {
if( this.value == '' ) {
this.value = '';
}
11-21 13:22:49.850: ERROR/Web Console(7957): Error: [$rootScope:inprog] $apply already in progress
http://errors.angularjs.org/1.2.0-rc.3/$rootScope/inprog?p0=%24apply
at file:///android_asset/www/app/lib/angular/angular.js:78:12
at beginPhase (file:///android_asset/www/app/lib/angular/angular.js:10995:15)
at Scope.$apply (file:///android_asset/www/app/lib/angular/angular.js:10795:11)
at HTMLDocument.<anonymous> (file:///android_asset/www/app/js/app.js:65:32)
at Object.cordova.fireDocumentEvent (file:///android_asset/www/cordova.js:224:22)
at file:///android_asset/www/plugins/org.apache.cordova.network-information/www/network.js:71:21
at Object.cordova.callbackFromNative (file:///android_asset/www/cordova.js:289:54)
at processMessage (file:///android_asset/www/cordova.js:1026:21)