Skip to content

Instantly share code, notes, and snippets.

@slowprog
slowprog / embedded-file-viewer.md
Last active July 14, 2018 13:26 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive, Zoho

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@slowprog
slowprog / address-to-lat-lng-coordinates.md
Created July 8, 2018 23:26
Finding the latitude and longitude by address with the Google Maps API

Finding coordinates by address with the Google Maps API

<?php

// Google maps - Geocoding
function google_maps_search($address, $key = '')
{
    $url = sprintf('https://maps.googleapis.com/maps/api/geocode/json?address=%s&key=%s', urlencode($address), urlencode($key));
    $response = file_get_contents($url);
@slowprog
slowprog / docker-compose.yml
Last active March 7, 2018 16:05
Docker-compose for rancher, nginx and let's encrypt
version: '2'
services:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
@slowprog
slowprog / phabricator_readme.md
Created January 23, 2016 06:17 — forked from sparrc/phabricator_readme.md
Phabricator Ubuntu Installation Guide

Phabricator Ubuntu Installation Guide

This is a supplement to the official Phabricator Installation Guide, because their guide will leave you with all kinds of permission and config errors and ~15,000 setup issues on startup.

Install bonus packages:

# apt-get install mercurial subversion python-pygments sendmail imagemagick

Create necessary users and add phd-user to sudoers:

<?php
// Standalone context.
define('PDFTOHTML_PATH', 'X:/PATH TO/workspace/_ouplayer_data/pdftohtml-0.39/pdftohtml.exe'); # Windows.
#define('PDFTOHTML_PATH', '/usr/bin/pdftohtml'); # Redhat 6.
require_once 'libraries/pdftohtml.php';
//( Or, CodeIgniter context. )
#$config['pdftohtml_path'] = '/usr/bin/pdftohtml';
#$this->load->library('pdftohtml');
<?php
namespace Linkofy\CommonBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class Builder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)