Skip to content

Instantly share code, notes, and snippets.

View lephleg's full-sized avatar
🗿
wassup

Argyris Margaritis lephleg

🗿
wassup
  • Tumblr Inc.
  • Thessaloniki, Greece
View GitHub Profile
@lephleg
lephleg / gist:fa07777eb8147edae1d41b0d87e8a87e
Last active May 22, 2024 13:03
Ads A8C Grafana Template
{{ define "ads.slack.title" }}
{{ if gt (len .Alerts.Firing) 0 }}
🔥 {{ len .Alerts.Firing }} alert(s) firing
{{ end }}
{{ if gt (len .Alerts.Resolved) 0 }}
✅ {{ len .Alerts.Resolved }} alert(s) resolved
{{ end }}
{{ end }}
curl --request POST \
--url http://localhost:9999/api/ads \
--header 'Content-Type: application/json' \
--header 'User-Agent: insomnia/8.6.1' \
--data '{
"campaigns": [
{
"campaign_id": 223372036852,
"creative": "<div><h1>Kaufen Sie das beste Produkt aller Zeiten!</h1><p>Verpassen Sie nicht unser exklusives Angebot.</p></div>",
"start_at": "2024-03-10T00:00:00.00Z",
{
"campaigns":[
{
"campaign_id":200030,
"creative":"<iframe style=\"width: 100%; height: 200px; border: 0; margin: 0; padding: 0;\" onload='\\''javascript:(function(o){o.style.height=o.contentWindow.document.body.scrollHeight+\"px\";}(this));'\\'' srcdoc='\\''<html lang=en> <head> <style> html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, img { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } body { line-height: 1; overflow: hidden; } </style> <style> h1, h3 { font-family: system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; font-style: normal; margin: 0; } h1 { color: rgba(0, 0, 0, 0.60); font-size: 12px; font-weight: 400; line-height: 125%; word-break: break-word; } h3 { color: #000
@lephleg
lephleg / xbl_oauth2.py
Created November 20, 2022 19:24 — forked from tuxuser/xbl_oauth2.py
Sign in to Xbox Live with OAUTH2
"""
Sign in to Xbox Live with OAUTH2
1. Go to https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade
2. Register new app ("+ New registration")
2.1. Enter a name for your app
2.2. Set "Supported account types" to "Personal Microsoft accounts only"
2.3. Click register
2.4. Choose "Redirect URIs" -> "Add a Redirect URI"
2.5. Click "Add a platform" -> "Mobile and desktop applications"
@lephleg
lephleg / gist:f59a5f9ad32e37c96c2ad4a3ef163ee4
Created March 15, 2021 12:42
REST API "object" strings left untouched
✓ james@compu <WP>/src/wp-includes/rest-api $ ack '(the|this|by) (resource|object)'
fields/class-wp-rest-meta-fields.php:18: * Retrieves the object meta type.
fields/class-wp-rest-meta-fields.php:29: * Retrieves the object type for register_rest_field().
fields/class-wp-rest-meta-fields.php:379: * Retrieves the object's meta schema, conforming to JSON Schema.
endpoints/class-wp-rest-controller.php:36: * Registers the routes for the objects of the controller.
endpoints/class-wp-rest-controller.php:480: * @param string $object_type Optional. The object type.
endpoints/class-wp-rest-controller.php:481: * @return array Registered additional fields (if any), empty array if none or if the object type could
endpoints/class-wp-rest-controller.php:504: * Retrieves the object type this controller is responsible for managing.