Skip to content

Instantly share code, notes, and snippets.

View ponciusz's full-sized avatar

Kamil Albrycht ponciusz

View GitHub Profile
rules_version = '2';
// Note: When editing the rules, consider using the online Rules Simulator:
// e.g. https://console.firebase.google.com/u/0/project/vue-rollup-example/database/firestore/rules
//
service cloud.firestore {
match /databases/{database}/documents {
// tbd. removed projects likely to get their own collection (simpler)
/*
Mixin for ACF colored pagebuilder
elements (flexible content field)
--- $name = name of flex content field
--- $color = color? :)
*/
@mixin acfsection($name, $color) {
[data-name="#{$name}"] {
background-color: lighten($color, 20%);
/* How To Use
$('.class').starterPlugin({
FontSize: 40
});
*/
// The semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
;(function ($, window, document, undefined) {
@ponciusz
ponciusz / pageBuilder.php
Created October 26, 2017 20:17
pageBuilder.php
<?php
function acf_PageBuilder( $name = '' ) {
$rows = get_field( $name );
if ( $rows ) {
// Adding all page/post related info to $context['post'] Array()
$context = Timber::get_context();
$context['post'] = new TimberPost();
foreach ( $rows as $row ) {
@ponciusz
ponciusz / capture.js
Created January 8, 2017 18:54 — forked from gaspanik/capture.js
Take screenshot at single viewport size using CasperJS
var screenshotUrl = 'http://example.com/'
var casper = require("casper").create({
viewportSize: {
width: 1024,
height: 768
}
});
if (casper.cli.args.length < 1) {
@ponciusz
ponciusz / gist:ac6f36b6cd886c46c155
Created December 22, 2015 23:08 — forked from clnmcgrw/gist:9086505
Google Maps API Geocode Example - PHP/JSON
<?php
// address to map
$map_address = "";
$url = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=".urlencode($map_address);
$lat_long = get_object_vars(json_decode(file_get_contents($url)));
// pick out what we need (lat,lng)
$lat_long = $lat_long['results'][0]->geometry->location->lat . "," . $lat_long['results'][0]->geometry->location->lng;