Skip to content

Instantly share code, notes, and snippets.

View maier-stefan's full-sized avatar
🏠
Working from home

Stefan Maier maier-stefan

🏠
Working from home
View GitHub Profile
@maier-stefan
maier-stefan / facebook_screenshot_template_mobile_feed_standard_single_video.html.erb
Last active September 22, 2022 17:46
Facebook Ad template rendering for single image and video
<html>
<head>
<style>
.container {
width: 320px;
display: flex;
flex-direction: column;
}
.header {
{
"name": "recipe1"
}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<script>
function resizeIframe(obj) {
obj.style.height = screen.height + 'px';
obj.style.width = screen.width + 'px';
}
</script>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
{"railcards":[{"code":"TSU","description":"16-17 Saver","maxAdults":8,"minAdults":1,"maxChildren":0,"minChildren":0},{"code":"YNG","description":"16-25 Railcard","maxAdults":8,"minAdults":1,"maxChildren":4,"minChildren":0},{"code":"TST","description":"26-30 Railcard","maxAdults":8,"minAdults":1,"maxChildren":4,"minChildren":0},{"code":"NGC","description":"Annual Gold Card","maxAdults":4,"minAdults":0,"maxChildren":8,"minChildren":0},{"code":"C50","description":"Club 50","maxAdults":1,"minAdults":1,"maxChildren":0,"minChildren":0},{"code":"DCG","description":"Devon & Cornwall Gold Card","maxAdults":2,"minAdults":0,"maxChildren":4,"minChildren":0},{"code":"DCR","description":"Devon & Cornwall Railcard","maxAdults":2,"minAdults":0,"maxChildren":4,"minChildren":0},{"code":"DIS","description":"Disabled Persons Railcard","maxAdults":2,"minAdults":1,"maxChildren":4,"minChildren":0},{"code":"FAM","description":"Family & Friends Railcard","maxAdults":4,"minAdults":0,"maxChildren":4,"minChildren":0},{"code":"GS3","desc
@maier-stefan
maier-stefan / example_frankfurt_pan.json
Last active September 27, 2018 21:51
Example Requests
{
"contact": {
"firstName": "Hansi",
"lastName": "Haller",
"phone": "1230921039",
"email": "hans10405@datalove.io",
"street": "Torstraße",
"streetNumber": "213"
},
"tracking": {
@maier-stefan
maier-stefan / Post.rb
Created February 16, 2018 10:16 — forked from cflipse/Post.rb
External Validations using only ActiveModel
require 'active_model'
# Most of this is the basic boilerplate described in the docs for active_model/errors; ie, the bare minimum
# a class must have to use AM::Errors
class Post
extend ActiveModel::Naming
attr_reader :errors
attr_accessor :title, :author, :publication_date
@maier-stefan
maier-stefan / Axis.js
Created January 5, 2018 18:15 — forked from MrToph/Axis.js
Charts in React Native with React-Native-SVG and D3.js
import React, { Component, PropTypes } from 'react'
import { G, Line, Path, Rect, Text } from 'react-native-svg'
import * as d3scale from 'd3-scale'
import { dateToShortString } from '../utils'
export default class Axis extends Component {
static propTypes = {
width: PropTypes.number.isRequired,
ticks: PropTypes.number.isRequired,
x: PropTypes.number,
@maier-stefan
maier-stefan / facebook.rb
Created December 10, 2016 05:11 — forked from a14m/facebook.rb
Gist for manually OAuth2 facebook for Rails APIs
# lib/omniauth/facebook.rb
require 'httparty'
module Omniauth
class Facebook
include HTTParty
# The base uri for facebook graph API
base_uri 'https://graph.facebook.com/v2.3'
@maier-stefan
maier-stefan / doc.md
Created February 2, 2016 20:42 — forked from oelmekki/doc.md
Rails + Browserify + React + es7

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.

@maier-stefan
maier-stefan / Dockerfile
Created January 14, 2016 21:32 — forked from benschw/Dockerfile
MySQL Docker Container
FROM ubuntu
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get -y install mysql-client mysql-server