This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# You can set up sSMTP by setting the following ENV variables: | |
# | |
# SSMTP_TO - This is the address alarms will be delivered to. | |
# SSMTP_SERVER - This is your SMTP server. Defaults to smtp.gmail.com. | |
# SSMTP_PORT - This is the SMTP server port. Defaults to 587. | |
# SSMTP_USER - This is your username for the SMTP server. | |
# SSMTP_PASS - This is your password for the SMTP server. Use an app password if using Gmail. | |
# SSMTP_TLS - Use TLS for the connection. Defaults to YES. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Tit Petric, Monotek d.o.o., Tue 03 Jan 2017 06:54:56 PM CET | |
-- | |
-- Delete nginx cached assets with a PURGE request against an endpoint | |
-- supports extended regular expression PURGE requests (/upload/.*) | |
-- | |
function file_exists(name) | |
local f = io.open(name, "r") | |
if f~=nil then io.close(f) return true else return false end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ffi = require("ffi") | |
local awesome = ffi.load("./awesome.so") | |
ffi.cdef([[ | |
typedef long long GoInt64; | |
typedef unsigned long long GoUint64; | |
typedef GoInt64 GoInt; | |
typedef GoUint64 GoUint; | |
typedef double GoFloat64; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"fmt" | |
"go/parser" | |
"go/token" | |
"log" | |
"os" | |
"path/filepath" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Tit Petric, Monotek d.o.o., Thu 27 Oct 2016 10:43:38 AM CEST | |
-- | |
-- Delete nginx cached assets with a PURGE request against an endpoint | |
-- | |
local md5 = require 'md5' | |
function file_exists(name) | |
local f = io.open(name, "r") | |
if f~=nil then io.close(f) return true else return false end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** A poor mans GraphQL fields parser | |
* | |
* Try to convert graphQL fields to JSON and then just use json_decode to produce an array. | |
*/ | |
class Fields | |
{ | |
/** Parse GraphQL fields into an array */ | |
public static function parse($query) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function docker_run_shell { | |
NAME=$1 | |
DOCKERFILE=$2 | |
# docker needs a few libraries, but not all - essential libs here | |
BIND_LIBS=`ldd /usr/bin/docker | grep /lib/ | awk '{print $3}' | egrep '(apparmor|libseccomp|libdevmap|libsystemd-journal|libcgmanager.so.0|libnih.so.1|libnih-dbus.so.1|libdbus-1.so.3|libgcrypt.so.11)'` | |
ARGS="" | |
for LIB in $BIND_LIBS; do | |
ARGS="$ARGS -v $LIB:$LIB:ro" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AnimalDependencies; | |
trait Dog { | |
private $dog = false; | |
function setDog(\Animals\Dog $dog) { | |
$this->dog = $dog; | |
} | |
function getDog() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"guzzlehttp/guzzle": "~6.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<blockquote class="tweet-this"> | |
<p><a href="http://twitter.com/intent/tweet?url={{ .Page.Permalink }}&text="{{ .Get 0 }}"&via=TitPetric" target="_blank">"{{ .Get 0 }}" via @TitPetric</a></p> | |
<a href="http://twitter.com/intent/tweet?url={{ .Page.Permalink }}&text="{{ .Get 0 }}"&via=TitPetric" target="_blank"><i class="fa fa-twitter"></i>Click to Tweet</a> | |
</blockquote> |
NewerOlder