Skip to content

Instantly share code, notes, and snippets.

@jsphpl
jsphpl / mac-startup-script-locations.md
Created Aug 14, 2017
Where macOS looks for services to launch on boot
View mac-startup-script-locations.md

These are the typical locations where startup plist files are stored. Yet, they can be located anywhere as long as they've been registered with launchctl.

  • ~/Library/LaunchAgents
  • /Library/LaunchAgents
  • /Library/LaunchDaemons
  • /Library/StartupItems
  • /System/Library/LaunchAgents
  • /System/Library/LaunchDaemons
@jsphpl
jsphpl / NPerGroup.php
Last active May 26, 2020 — forked from tureki/BaseModel.php
laravel-pgsql-n-related-models-per-parent-with-scopes
View NPerGroup.php
<?php
namespace App\Models\Traits;
use DB;
/**
* This trait is to work around a problem where a limit on an Eloquent
* relation by default applies to all queried models in total.
*
@jsphpl
jsphpl / woocoomerce-export-users-sql.md
Created Jul 12, 2017
An SQL query to extract customer names and addresses from WooCommerce
View woocoomerce-export-users-sql.md
SELECT
	u.user_email,
	max( CASE WHEN um.meta_key = 'billing_first_name' and u.ID = um.user_id THEN um.meta_value END ) AS first_name,
	max( CASE WHEN um.meta_key = 'billing_last_name' and u.ID = um.user_id THEN um.meta_value END ) AS last_name,
	CASE WHEN max( CASE WHEN um.meta_key = 'billing_title' and u.ID = um.user_id THEN um.meta_value END ) = 1 THEN 'Herr' ELSE 'Frau' END AS title,
	max( CASE WHEN um.meta_key = 'billing_address_1' and u.ID = um.user_id THEN um.meta_value END ) AS street,
	max( CASE WHEN um.meta_key = 'billing_postcode' and u.ID = um.user_id THEN um.meta_value END ) AS zip,
	max( CASE WHEN um.meta_key = 'billing_city' and u.ID = um.user_id THEN um.meta_value END ) AS city,
	max( CASE WHEN um.meta_key = 'billing_country' and u.ID = um.user_id THEN um.meta_value END ) AS country #,
@jsphpl
jsphpl / lapdock-an-raspberry-kabel.md
Last active Mar 27, 2017
Anschlusskabel für ein Motorola Atrix Dock (a.k.a. "Lapdock") an einen Raspberry Pi (Model B & A)
View lapdock-an-raspberry-kabel.md

Anschlusskabel für Motorola Lapdock an Raspberry Pi

Du brauchst ein Kabel für die Videoübertragung, eins zum Anschließen von Tastatur/Trackpad und eins zur Stromversorgung.

Video:

  • Micro-HDMI female to HDMI male Kabel (z.B. Amazon)
  • Alternative: Micro-HDMI female-to-female Adapter (z.B. Amazon) + Micro-HDMI male to HDMI male Kabel (z.B. Amazon)

Tastatur/Trackpad:

View Upgrading the RepRapPro Huxley to Marlin 1.1.0-RC8.md

Upgrading the RepRapPro Huxley to Marlin 1.1.0-RC8

1. Download Marlin

…from https://github.com/MarlinFirmware/Marlin/releases/tag/1.1.0-RC8

2. Backup current EEPROM settings

…in case they get overwritten through the firmware update. To do so, issue a M501 (set all parameters from EEPROM) followed by a M503 (dump current settings) and save the output of that command.

View keybase.md

Keybase proof

I hereby claim:

  • I am jsphpl on github.
  • I am jsphpl (https://keybase.io/jsphpl) on keybase.
  • I have a public key ASCbd6kO6BzwSKmsh_d5K5BdixKU9PblkRAFv5nB2mBe8wo

To claim this, I am signing this object:

@jsphpl
jsphpl / slash-http-programming-languge.md
Last active Jul 12, 2017
Concept for a true web programming language
View slash-http-programming-languge.md

slas// (slash)

a true web programming language

Imagine a programming language in which every function call is a HTTP request.

– or, at least, making an http request is a first class language feature. Each component could still be written in any language and would be re-usable in slash over HTTP as a "picoservice".

Such a language might be interesting for hooking up APIs while processing the data in transit. And it seems like web programming increasingly means doing exactly that: Creating APIs by plugging together some other APIs.

No matter what the purpose might be, i simply like playing with the idea of seeing a function call as an http request. So first of all, i want to think about how such a languge might look like, so i've made up a short example:

You can’t perform that action at this time.