Skip to content

Instantly share code, notes, and snippets.

Martins Talbergs talbergs

Block or report user

Report or block talbergs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
talbergs /
Created Aug 3, 2018 — forked from robacarp/
crystal single character read from stdin
print "Type something: "
entered_chars = [] of Char
STDIN.raw do
loop do
char = STDIN.read_char
next if char.nil?
talbergs /
Last active Jun 16, 2017 — forked from wdullaer/
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp:// --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb docker main > /etc/apt/sources.list.d/docker.list"
View console.image.js
* Dubiously created by Adrian Cooney
(function(console) {
"use strict";
* Since the console.log doesn't respond to the `display` style,
* setting a width and height has no effect. In fact, the only styles
* I've found it responds to is font-size, background-image and color.
View cleanup-all
docker rm $(docker ps -a -q) -f && docker rmi $(docker images -q) -f
apt-get -y update && \
apt-get -y install git-core zsh && \
wget -O - | zsh && \
chsh -s `which zsh` && \
echo 'PROMPT="[drone]$PROMPT"' >> ~/.zshrc && \
echo 'alias rr=". ~/.zshrc"' >> ~/.zshrc && \
echo 'alias d="docker"' >> ~/.zshrc && \
echo 'alias dc="docker-compose"' >> ~/.zshrc && \
echo 'rebooting... log back in 2 minutes' && \
sudo shutdown -r 0
View install-docker-ubuntu16
sudo apt-get update
sudo apt-get -y --no-install-recommends install curl apt-transport-https ca-certificates curl software-properties-common
curl -fsSL | sudo apt-key add -
apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D | grep iud
sudo add-apt-repository "deb ubuntu-$(lsb_release -cs) main"
sudo apt-get update
sudo apt-get -y install make docker-engine
sudo docker run hello-world
talbergs / Caddyfile
Created Dec 12, 2016
Docker[ Caddy php7 ]
View Caddyfile
fastcgi / phpfmp:9000 php
View php_ssh_example.php
$ip = '';
$user = 'root';
$pass = 'pass';
$conn = ssh2_connect($ip);
ssh2_auth_password($conn, $user, $pass);
$stream = ssh2_exec($conn, 'whoami');
stream_set_blocking($stream, true);
View miniHandlebars.js
String.prototype.template = function(obj) {
// dot notation path getter for array and obj
function objPath(obj, path){
var arr = path.split('.');
while (arr.length && obj) {
obj = obj[arr.shift()]
if(obj === undefined) return '{undefined '+path+'}';
View jQuery.$cache.js
jQuery.prototype.$cache = function(xpath, name) {
if (xpath.forEach) {
} else {
!name && (name = xpath.substr(1));
this[name] = this.find(xpath)
return this;
You can’t perform that action at this time.