Skip to content

Instantly share code, notes, and snippets.

View afjlambert's full-sized avatar

André Lambert afjlambert

View GitHub Profile
@petrosagg
petrosagg / Cargo.toml
Created January 27, 2021 09:56
postgres full dump and atomic switch to replication
[package]
name = "postgres-replication-poc"
version = "0.1.0"
authors = ["Petros Angelatos <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio-postgres = { path = "../rust-postgres/tokio-postgres" }
@afjlambert
afjlambert / tagmanager-adsense-tag
Last active August 29, 2015 14:18
Create a new custom tag in your tagmanager and paste this in. Add the html div to your page.
<script>
/*
Replace the 'pub-xxxxxxxxxxxxxxxx' with your own Google Adsense publisher-id.
Update the 'positions' with the data from your Google Adsense account page.
Usage:
<div class="tagmanager_ad" data-name="rectangle"></div>
*/
var publisherId = "pub-xxxxxxxxxxxxxxxx",
@ento
ento / pymongo.py
Created March 30, 2012 00:56
Flask-PyMongo datastore for Flask-Admin
# -*- coding: utf-8 -*-
from flask.ext.admin import datastore
from flask.ext.admin import util
from flask.ext.wtf import Form
from pymongo.objectid import ObjectId
from pymongo.errors import OperationFailure
class Any(object):