Skip to content

Instantly share code, notes, and snippets.

@azappella
azappella / type-notes.rst
Created January 23, 2019 19:15 — forked from tomleo/type-notes.rst
Opensource Fonts

Serif

Libre Caslon:

http://www.impallari.com/projects/overview/libre-caslon-display-and-text

Domine:

http://www.google.com/fonts/specimen/Domine
@azappella
azappella / geth-secure.md
Created October 18, 2018 15:20 — forked from miohtama/geth-secure.md
Secure RPC connections to geth daemon

Go Ethereum (geth) is a software for Ethereum. geth doesn't provide secure networking and it should do this, as this kind of built-in functionality would increase complexity and add attack surface to critical blockchain node software. Fortunately, in UNIX world, you can easily combine different tools to work together. The solution to this particular problem is to use VPN/tunneling software for secure connections. The tunnel will expose the server local connections to your own computer. The most popular tool for this (available in every OS by default, nowadays including Windows) is [Secure Shell (SSH)][1].

Note this question only addresses issues how to

[If you are not familiar with SSH please first read SSH tutorial how to safely do passwordless logins using SSH keys][2].

Start a node on server. When the node starts it binds its RPC port to localhost (127.0.0.1 in IPv4, ::1 in IPv6). This is so-called loopback connection that you can only access from the computer itself and not from external netwo

@azappella
azappella / xml-parser.js
Last active April 17, 2018 14:27
XML Parser & Transformer
// Source: Andrew Stewart
// https://andrew.stwrt.ca/posts/js-xml-parsing/)
// get your XML in a text format
// var xmlText = getXMLString();
// use the DOMParser browser API to convert text to a Document
// var XML = new DOMParser().parseFromString(xml, "text/xml");
// and then use #parse to convert it to a JS object
@azappella
azappella / install-packages.sh
Created October 31, 2017 13:58 — forked from Musinux/install-packages.sh
VNC xstartup for unity
#!/bin/bash
sudo apt-get install vnc4server ubuntu-desktop
sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
@azappella
azappella / Dockerfile-apache
Created September 22, 2017 13:33 — forked from EvgenyOrekhov/Docker Compose files for PHP development.md
Docker Compose files for PHP development
FROM php:apache
RUN apt-get update \
&& apt-get install -y --no-install-recommends libpq-dev \
&& docker-php-ext-install pdo_pgsql pdo_mysql
@azappella
azappella / dockerTunnel.md
Created September 20, 2017 17:42 — forked from aduermael/dockerTunnel.md
Connect to remote Docker engine through SSH tunnel

Bind remote docker.sock with SSH tunnel:

ssh -nNT -L /tmp/docker.sock:/var/run/docker.sock  <USER>@<IP> &

Set environment variable for local Docker client:

export DOCKER_HOST=unix:///tmp/docker.sock
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@azappella
azappella / wp.dev
Created November 6, 2015 14:59
nginx wordpress virtual host
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.wp.dev;
rewrite ^ http://wp.dev$request_uri?;
}
@azappella
azappella / functions.php
Created April 20, 2015 12:17
Remove wordpress text editor added p tags around img elements
<?php
// Source: https://css-tricks.com/snippets/wordpress/remove-paragraph-tags-from-around-images/
function filter_ptags_on_images($content){
return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
}
add_filter('the_content', 'filter_ptags_on_images');
@azappella
azappella / README.md
Last active November 22, 2022 21:57 — forked from oodavid/README.md
Github automatic deployment (with webhooks)

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/