Skip to content

Instantly share code, notes, and snippets.

View phortx's full-sized avatar

Ben Klein phortx

View GitHub Profile
@phortx
phortx / spec.md
Last active October 12, 2018 10:34
API specification for Vuex-ORM persistence plugins

Current state

Method Plugin-GraphQL Plugin-Axios
Read multiple Model.fetch(filter) Model.$fetch()
Read single Model.fetch(id) Model.$get()
Create record.$persist(), Model.persist() Model.$create()
Update record.$push(), Model.push() Model.$update()
Delete record.$destroy(), Model.destroy() Model.$delete()
Model related custom Model.customQuery() ?
@phortx
phortx / model.js
Last active May 3, 2020 22:27
Vuex-ORM model base class with convenience methods
import { Model as ORMModel } from '@vuex-orm/core';
/**
* Wrapper for models to provide model level convenience methods for interacting with the store and persistence.
* Will be built into vuex-orm in the future. See https://github.com/vuex-orm/vuex-orm/issues/60
*
* Requires the inflected npm package.
*/
export default class Model extends ORMModel {
/**
@phortx
phortx / test.html
Created October 12, 2015 09:28
Test HTML File for wkhtmltopdf widow/orphan test
<!DOCTYPE html>
<html>
<head>
<title>Test Site</title>
<style>
h1, h2, h3, h4, h5, h6 {
page-break-after: avoid;
page-break-inside: avoid;
orphans: 3;
widows: 3;
@phortx
phortx / What happens.sh
Last active August 29, 2015 13:57
Strange autoparts package errors
$ parts install zsh
=> Extracting archive...
=> Installing...
=> Activating...
=> Installed zsh 5.0.5
$ parts install vlc
=> Extracting archive...
=> Compiling...
@phortx
phortx / gist:9204330
Created February 25, 2014 07:21
Ruby 2.1.1 benchmark
@phortx
phortx / gist:8555551
Created January 22, 2014 08:55
Downgrade gitlab-grack to 1.0.1 on a 6.4 installation
% git diff
diff --git a/Gemfile b/Gemfile
index 2019cae..381869a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -33,7 +33,8 @@ gem 'omniauth-github'
gem "gitlab_git", "~> 4.0.0.pre"
# Ruby/Rack Git Smart-HTTP Server Handler
-gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack'
@phortx
phortx / works_not.rb
Last active January 1, 2016 12:39
works not
class Test
private def foo
3.times do
puts "hello world"
end
end
private def bar
end
end
@phortx
phortx / works.rb
Last active January 1, 2016 12:39
Works
class Test
def foo
3.times do
puts "hello world"
end
end
private def bar
end
end
@phortx
phortx / gist:4059848
Created November 12, 2012 15:02
Java Unicode German Umlaut Escape Sequences
Char Unicode
------------------------------
Ä, ä \u00c4, \u00e4
Ö, ö \u00d6, \u00f6
Ü, ü \u00dc, \u00fc
ß \u00df