Skip to content

Instantly share code, notes, and snippets.

View degerstrom's full-sized avatar

Pål Degerstrøm degerstrom

View GitHub Profile
swagger: '2.0'
info:
description: |
EcoOnline REST API for the ByggDok project.
All responses from the API will be formatted according to the JSON API specification, which for example means that the expected response items will be wrapped in a `data {}` object, and pagination in a `links {}` object. Both of these elements have been omitted from the documentation below for brevity.
version: unreleased
title: EcoOnline
host: app-test.ecoonline.com
basePath: /app/api
schemes:
{
"nodes": [
{
"name": "Marius",
"type": "Person",
"relationships": [
{
"name": "BMW",
"type": "Owner"
}
@degerstrom
degerstrom / helpers.php
Last active August 29, 2015 14:25
VC helpers syntax error
// Line 96 in js_composer/include/helpers/helpers.php has:
$thumbnail = '<img ' . vc_array_to_attr_string( $attributes ) . '" />';
// But it should be
$thumbnail = '<img ' . vc_array_to_attr_string( $attributes ) . ' />';
@degerstrom
degerstrom / homestead_macosx.md
Last active August 29, 2015 14:15
Notes for Homestead on Mac OS X

Notes on how I fixed the terrible Homestead performance on Mac OS X.

Shared folders seem to be an issue. Do this in homestead.rb (mine was located in ~/.composer/vendor/laravel/homestead/scripts/):

# Register All Of The Configured Shared Folders
# (Comment the lines following, and insert this:)
settings["folders"].each do |folder|
  config.vm.synced_folder folder["map"], folder["to"],
    id: folder["map"],
    :nfs => true,
@degerstrom
degerstrom / ee_msm_pages_siteurl_fix.php
Last active August 29, 2015 13:57
PHP script to change the site url for structured pages in an ExpressionEngine MSM site
<?php
/*
This is a fix for wrong URLs when moving content between environments and using Structure with ExpressionEngine MSM sites.
(This is probably not specific to Structure, but I do not use the native Pages add-on).
This is in no way secure. *Do not leave this available on your webserver at any time*.
Be warned: This is a super-hack. There is probably a better way to do this, but this works for me.
I give this file a completely random name, and delete it immediately from my production server when I'm done.
@degerstrom
degerstrom / gist:6193850
Created August 9, 2013 14:05
A trivial example for a client.
$(document).ready(function () {
alert('Foo');
});
<?php
/**
* PHP class to convert Latitude & Longitude coordinates into UTM & Lambert Conic Conformal Northing/Easting coordinates.
*
* This class encapsulates the methods for representing a geographic point on the earth in three different coordinate systema. Lat/Long, UTM and Lambert Conic Conformal.
*
* Code for datum and UTM conversion was converted from C++ code written by Chuck Gantz (chuck.gantz@globalstar.com) from http://www.gpsy.com/gpsinfo/geotoutm/
* This code was converted into PHP by Brenor Brophy (brenor@sbcglobal.net) and later refactored for PHP 5.3 by Hans Duedal (hd@onlinecity.dk).
*
@degerstrom
degerstrom / QUERY_PARAM.md
Created October 20, 2011 02:00 — forked from airways/QUERY_PARAM.md
ExpressionEngine: new QUERY_PARAM protocol that always works

QUERY_PARAM Protocol

This is a simple technique which should work on ALL hosts to allow ExpressionEngine to handle URLs without index.php in them. Hopefully EllisLab will add this as a built-in option soon.

IJR