Skip to content

Instantly share code, notes, and snippets.

@nshkuro
nshkuro / setup vpn script
Last active July 26, 2019 04:17
DigitalOcean VPN script. Ubuntu 12.04
#!/bin/bash
echo "Select on option:"
echo "1) Set up new PoPToP server AND create one user"
echo "2) Create additional users"
read x
if test $x -eq 1; then
echo "Enter username that you want to create (eg. client1 or john):"
read u
echo "Specify password that you want the server to use:"
read p
@nshkuro
nshkuro / gist:5829377
Last active March 10, 2020 10:32
Drupal Commerce - Price without the decimal
<?php
/**
* Implementation hook_commerce_currency_info_alter()
*/
function MODULE_commerce_currency_info_alter(&$currencies, $langcode) {
$currencies['RUB']['format_callback'] = 'MODULE_commerce_currency_format';
}
function MODULE_commerce_currency_format($amount, $currency, $object = NULL, $convert = TRUE) {
@nshkuro
nshkuro / continents-template
Created October 24, 2011 04:39
Continents - SVG JQuery Template
script(type="text/html")#continents-template
h2 Continents
svg(version="1.0", xmlns="http://www.w3.org/2000/svg", width="468pt", height="239pt", viewBox="0 0 468 239", preserveAspectRatio="xMidYMid meet")
g(transform="translate(0,239) scale(0.016963,-0.016963)", fill="#000000", stroke="none")
path(d="M13728 10231 c-34 -19 -84 -21 -109 -5 -6 4 -15 1 -19 -5 -5 -9 -14 -9 -35 1 -22 10 -29 10 -33 0 -2 -6 -11 -12 -21 -12 -9 0 -23 -6 -29 -12 -10 -10 -17 -10 -32 0 -27 16 -55 15 -190 -7 -113 -19 -180 -42 -180 -63 0 -5 -7 -8 -15 -5 -8 4 -17 2 -20 -3 -4 -6 -13 -10 -21 -10 -8 0 -26 -11 -40 -25 -14 -14 -30 -25 -37 -26 -25 -2 -62 3 -70 10 -4 4 -33 4 -65 0 -63 -9 -100 6 -109 42 -6 20 -20 24 -39 11 -6 -4 -22 -32 -35 -62 -34 -81 -57 -108 -119 -137 -60 -29 -120 -82 -120 -107 0 -9 -10 -31 -22 -47 -18 -24 -23 -44 -23 -94 0 -38 -5 -69 -12 -76 -7 -7 -13 -18 -13 -24 0 -5 -16 -24 -36 -40 -20 -17 -45 -38 -56 -48 -23 -21 -80 -47 -103 -47 -22 0 -36 -16 -62 -72 -13 -27 -27 -48 -31 -48 -27 0 -82 -82 -82 -123 0 -24 -26 -64 -