Skip to content

Instantly share code, notes, and snippets.

@jabbink
jabbink / Albert Heijn app API.md
Last active June 11, 2024 09:12
Interact with the Albert Heijn mobile app API to retrieve receipt data, and other things

AH API

Always use User-Agent: Appie/8.22.3 and Content-Type: application/json
Technically there is more information about your device and user ID after it, but the server does not seem to care

Token

If you have a valid access_token, add it as a header in request
Authorization: Bearer access_token

@stevenmaguire
stevenmaguire / laravel-nearby-locations-query-scope.php
Last active March 28, 2020 22:40
Laravel (Illuminate) query builder scope to list neighboring locations within a given distance from a given location
<?php
/**
* Query builder scope to list neighboring locations
* within a given distance from a given location
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
* @param mixed $lat Lattitude of given location
* @param mixed $lng Longitude of given location
* @param integer $radius Optional distance
@guilherme
guilherme / gist:9604324
Last active May 17, 2024 14:09
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='console.log'
# CHECK
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0
then
@cbosco
cbosco / all_my_facebook_photos.html
Last active November 9, 2023 23:34
Simple "get all of my facebook photos" facebook JS SDK + Graph API example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Photos with Friends!</title>
<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script>
/**
* This is the getPhoto library
*/