Skip to content

Instantly share code, notes, and snippets.

View bekatom's full-sized avatar
🎯
Focusing

Beka Tomashvili bekatom

🎯
Focusing
View GitHub Profile
@bekatom
bekatom / vault.sh
Created March 19, 2016 07:09
/etc/init.d/vault
#
# Daemon for vault
#
# chkconfig: 345 99 20
# description: Daemon for vault
# processname: vault
### BEGIN INIT INFO
# Provides: vault
# Required-Start: $network
@bekatom
bekatom / consul.sh
Created March 19, 2016 07:09
/etc/init.d/consul
#
# Daemon for Consul
#
# chkconfig: 345 99 20
# description: Daemon for vault
# processname: vault
### BEGIN INIT INFO
# Provides: consul
# Required-Start: $network
@bekatom
bekatom / mutability.py
Created August 4, 2015 13:49
Mutable list problems
# first version
def boo1(l=[]):
l = list(l)
l.append(1)
return l
# second version
def boo2(l=[]):
result = []
result.extend(l)
@bekatom
bekatom / card_shuffle.py
Created August 4, 2015 13:45
Custom card shuffle withouy shuffle method
from random import randrange
class Card():
def __init__(self, rank, suit):
self.rank = rank
self.suit = suit
card_list = [Card("HEARTS", 4),
@bekatom
bekatom / flask-test.py
Created July 28, 2015 11:00
flask-test.py
from flask import Flask
from flask.ext.testing import TestCase
from mtportal.app import create_app
class TestConfig(object):
DEBUG = False
TESTING = True
@bekatom
bekatom / list_to_dict.py
Created July 21, 2015 15:57
list_to_dict.py
#SQL alchemy object to list method
def to_dict(data):
"""
:param data:
:returns objects list in dictionary :
"""
return [u.__dict__ for u in data]
<script src="https://cdnjs.cloudflare.com/ajax/libs/trianglify/0.2.1/trianglify.min.js"></script>
<style>
width:500px;
height:500px;
</style>
<div id="main" class="main">
<script>
function addTriangleTo(target) {
@bekatom
bekatom / gulpfile.js
Last active October 19, 2018 13:26
Minify javascript and Css with gulp
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var minifyCss = require('gulp-minify-css');
gulp.task('js', function() {
return gulp.src('public/javascripts/*.js')
.pipe(uglify())
.pipe(gulp.dest('public/javascripts/min'));
});
@bekatom
bekatom / www_node.js
Created May 6, 2015 20:53
https_config_express_js
#!/usr/bin/env node
var debug = require('debug')('invoice');
var app = require('../app');
var path = require('path');
var fs = require('fs');
var https = require('https');
var http = require('http');
var key = fs.readFileSync('/etc/ssl/private/server.key');
@bekatom
bekatom / link_replace.js
Last active August 29, 2015 14:13
replace links