Skip to content

Instantly share code, notes, and snippets.


Maik B mediavrog

  • @shackersNFT
  • Germany / Japan
View GitHub Profile
mediavrog /
Created May 1, 2017
Default issue template at AIR

Expected behaviour

Actual behaviour

Steps to reproduce the behaviour

mediavrog /
Last active May 1, 2017
Default Pull Request template for AIR.

Fixes #

Changes proposed in this PR

Review requested by @

mediavrog / gist:49c4f809dffea4e00738a7f5e3bbfa59
Last active Jan 27, 2022
CORS in Google Cloud Functions for Firebase
View gist:49c4f809dffea4e00738a7f5e3bbfa59
const cors = require('cors')({origin: true});
exports.sample = functions.https.onRequest((req, res) => {
cors(req, res, () => {
mediavrog / main.js
Created Oct 24, 2016
Simple bootstrapping for a VueJS app with I18n, Routing and http client
View main.js
// VueJS with Router, I18n and simple http client
import Vue from "vue"
import VueI18n from "vue-i18n"
import VueRouter from "vue-router"
import VueResource from 'vue-resource'
// 2 pages for the app states
import Splash from "./pages/Splash.vue"
import Main from "./pages/Main.vue"
import App from "./App.vue"
// i18n strings
mediavrog /
Last active Aug 26, 2016
Javascript / Coffeescript snipped to use Google Analytics with Turbolinks in Rails 4
# add the tracking code normally to your layout; then include this in every page
$(document).on 'page:change', ->
ga('send', 'pageview');
else if window._gaq?
else if window.pageTracker?
mediavrog / findByXPath.js
Created Jun 27, 2015
Javascript find by XPath
View findByXPath.js
function getElementByXpath(path) {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
console.log( getElementByXpath("//html[1]/body[1]/div[1]") );
mediavrog / CustomActiveRecordDsl.scala
Last active Aug 29, 2015
JodaSupport ActiveRecord
View CustomActiveRecordDsl.scala
val jodaDateTimeConverter = new FormConverter[DateTime] {
override def serialize(v: Any): String =
new DateTime(v).toString(ISODateTimeFormat.dateHourMinuteSecond)
override def deserialize(s: String): DateTime =
new DateTime(s.toLong)
FormConverter.register(classOf[DateTime], jodaDateTimeConverter)
ClassInfo.factories.register(classOf[DateTime], {() =>[AnyRef]})
View ARAutoRollback.scala
import com.github.aselab.activerecord.{PlayConfig, ActiveRecordTables}
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach}
import play.api.Play
import play.api.test.FakeApplication
trait ActiveRecordAutoRollback extends BeforeAndAfterEach with BeforeAndAfterAll {
self: ApiBaseSpec =>
def schema: Seq[ActiveRecordTables] = Seq(ActiveRecordTables.find("models.Tables"))
View bound_greeting.js
* Assuming we have some object with properties and methods
var me = {
first_name: 'Ahikar',
last_name: 'Grilka',
race: 'Klingon',
email: '',
occupation: 'Commander of Defence',
greet: function(other_person){