Skip to content

Instantly share code, notes, and snippets.

@timlianov
timlianov / chef.rb
Last active August 29, 2015 14:15 — forked from gmcmillan/chef.rb
require 'base64'
require 'time'
require 'digest/sha1'
require 'openssl'
require 'net/https'
require 'json'
class ChefAPI
# Public: Gets/Sets the http object.
@timlianov
timlianov / gist:408fe439af4506a188c4
Created February 16, 2015 20:40
git log extension
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
puts `devops project list --format csv | cut -f2 -d ":"`.split("\n").map { |p_name|
`devops project show #{p_name} --format json | grep identifier`.split("\n")
}.flatten.size
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=320, initial-scale=1"/>
<title>jsmpeg streaming</title>
<style type="text/css">
body {
background: #333;
text-align: center;
margin-top: 10%;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div>
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim && \
echo "execute pathogen#infect()" > ~/.vimrc && \
echo "syntax on" >> ~/.vimrc && \
filetype plugin indent on >> ~/.vimrc &&\
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree \
# Shorthand Git CLI syntax + better git log
# Better git log
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
function gs {
git status
}
function gd {
@timlianov
timlianov / parent_path.sh
Created May 3, 2017 10:34
Relative paths based on file location instead of current working directory
#!/bin/bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$parent_path"
cat ../some.text
@timlianov
timlianov / gist:0eb19c508bd5e496f8c547bfd8a3fd8b
Created May 4, 2017 10:13 — forked from wsk3201/gist:8555039
Add bootstrap style to Backgrid.Paginator
var Paginator = Backgrid.Extension.Paginator = Backgrid.Extension.Paginator.extend({
render: function(){
Paginator.__super__.render.apply(this,arguments);
this.$el.find('ul').addClass('pagination');
return this;
}
});
@timlianov
timlianov / start_docker_registry.bash
Created October 29, 2020 12:19 — forked from u1i/start_docker_registry.bash
Start docker registry with letsencrypt certificates and Basic Auth
#!/usr/bin/env bash
# install docker
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
# install docker-compose
# https://docs.docker.com/compose/install/
# install letsencrypt
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04