Skip to content

Instantly share code, notes, and snippets.

@adamsrog
adamsrog / mg-webhook.php
Last active September 6, 2020 12:24
Mailgun webhook for delivering messages to Telegram Channel
<?php
// check for POST method
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// get payload data
$post = json_decode(file_get_contents('php://input'), true);
$signature = $post['signature'];
$data = $post['event-data'];
$key = "MAILGUNAPIKEY";
#!/bin/bash
# This script will go through each directory (excluding .git/ and ./) and run `jekyll build`,
# then deploy it to specified account contained in the .username file. It is assumed the scp
# connection is able to connect using a key pair.
# Get count of sites to build
sites=$(find . -type directory -maxdepth 1 | grep -v .git | sed -n '1!p' | wc -l)
echo "[i] Depolying Jekyll Sites: $sites"
DEPRECATION: `lookup` was called on a Registry. The `initializer` API no longer receives a container, and you should use an `instanceInitializer` to look up objects from the container. See http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers for more details.
at Object.Registry.lookup (http://localhost:4200/assets/vendor.js:12222:36)
at Object.<anonymous> (http://localhost:4200/assets/vendor.js:69066:45)
at Object.__exports__.default [as load] (http://localhost:4200/assets/vendor.js:70289:20)
at Object.initialize (http://localhost:4200/assets/whiiec-listing.js:436:32)
at http://localhost:4200/assets/vendor.js:14897:23
at http://localhost:4200/assets/vendor.js:14920:9
at visit (http://localhost:4200/assets/vendor.js:12800:5)
at DAG.topsort (http://localhost:4200/assets/vendor.js:12911:9)
at _emberRuntimeSystemNamespace.default.extend._runInitializer (http://localhost:4200/assets/vendor.js:14919:13)
// for @sunoceansand from comments on http://blog.willrax.com/oauth-with-firebase-and-ember
// change the login() in emberfire.js like so:
login: function() {
var _this = this; // cache this for usage within the Ember.RSVP.Promise
return new Ember.RSVP.Promise(function(resolve, reject) {
_this.get("ref").authWithOAuthPopup("facebook", function(error, user) {
if (user) {
resolve(user);
} else {
import DS from 'ember-data';
export default DS.RESTSerializer.extend({
normalizePayload: function(payload) {
// ember-data expects the data to be labeled { <your-model>: { ... } }
var newPayload = { "board":payload };
return newPayload;
}
});