Skip to content

Instantly share code, notes, and snippets.

View edwinv's full-sized avatar

Edwin Vlieg edwinv

View GitHub Profile
<?php
// Example code from http://www.moneybird.nl/blog
require_once 'moneybird_php_api/Api.php';
try {
// The customer id from the current user
$customerId = 2;
// Initialize the MoneyBird api
<filter_invoice_filter>
<filter_filter_rule>
<filter_scope>invoice_date</filter_scope>
<date_scope>period</date_scope>
<from_date>...</from_date>
<to_date>...</to_date>
</filter_filter_rule>
<filter_filter_rule>
<filter_scope>price</filter_scope>
<price_relative>more_than</price_relative>

Keybase proof

I hereby claim:

  • I am edwinv on github.
  • I am edwinvlieg (https://keybase.io/edwinvlieg) on keybase.
  • I have a public key whose fingerprint is 8F8D CBD6 BE6C 3465 86F8 A034 E542 B73D C480 FF7E

To claim this, I am signing this object:

@edwinv
edwinv / bugreport.rb
Last active September 2, 2015 09:44
PG::InvalidTextRepresentation exception
# Activate the gem you are reporting the issue against.
gem 'activerecord', '4.2.4'
require 'active_record'
require 'minitest/autorun'
require 'logger'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
# This connection will do for database-independent bug reports.
require 'rubygems'
require 'curb'
# Create a new Curl instance with the correct accept and content-type headers
c = Curl::Easy.new do |curl|
curl.headers["Accept"] = "application/json"
curl.headers["Content-Type"] = "application/json"
curl.http_auth_types = Curl::CURLAUTH_BASIC
curl.userpwd = "username:password"
end
@edwinv
edwinv / gist:5960407
Last active December 19, 2015 13:09
PostgreSQL exception library
require 'active_record/connection_adapters/postgresql_adapter'
module ActiveRecord
class NotNullViolation < ActiveRecord::WrappedDatabaseException
end
class CheckViolation < ActiveRecord::WrappedDatabaseException
end
@edwinv
edwinv / Gemfile
Created December 14, 2012 13:41 — forked from sr/Gemfile
source "http://rubygems.org"
gem "janky", :github => "github/janky"
gem "pg"
gem "thin"
gem "hipchat", "~>0.4"
gem "foreman"
@edwinv
edwinv / gist:2947994
Created June 18, 2012 11:40
ElasticSearch
curl -XPOST http://localhost:9200/test/?pretty=true -d '{
"settings": {
"analysis": {
"filter": {
"edgengram_filter": {
"type": "edgeNGram",
"max_gram": 20,
"min_gram": 2,
"side": "front"
}
@edwinv
edwinv / Gemfile
Created May 21, 2012 12:05
What's wrong with current Rails asset gems
# Define the original location of the library and the location of a mapping from this library
# to a valid Rails Engine. Making it easy to create a custom mapping on the local filesystem
# makes it very flexible, but sharing mappings with a Git repository should also be possible.
group :assets do
gem "chosen", :git => "git://github.com/harvesthq/chosen", :asset_mapping => "git://gist.github.com/..."
end