Install Docker CE:
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
'use strict'; | |
const pg = require('pg'); | |
console.time('time'); | |
var LOCK = `BEGIN; LOCK TABLE processed_files IN ACCESS EXCLUSIVE MODE;`; | |
var client1 = new pg.Client(`postgres://${process.env.POSTGRES_USER}:${process.env.POSTGRES_PASSWORD}@${process.env.POSTGRES_HOST}:${process.env.POSTGRES_PORT}/${process.env.POSTGRES_DB}`); | |
var client2 = new pg.Client(`postgres://${process.env.POSTGRES_USER}:${process.env.POSTGRES_PASSWORD}@${process.env.POSTGRES_HOST}:${process.env.POSTGRES_PORT}/${process.env.POSTGRES_DB}`); | |
client1.connect(function (err) { | |
console.timeEnd('time'); |
var notExpired = function(contract) { | |
if ($scope.expiration == $scope.expDates[0]) return true; | |
var date = new Date(contract.termTo); | |
//console.log($scope.expiration.substr(0,4)+" "+monthStrToNum($scope.expiration.substr(5,$scope.expiration.length-1)) +" "+(date.getMonth()+1)); | |
for(var year = 100; year<3000; year++) { | |
if((new Date(contract.termTo)).getFullYear() != year) { | |
try{ |
Install Docker CE:
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
table { | |
color: #333; | |
font-family: Helvetica, Arial, sans-serif; | |
width: 640px; | |
border-collapse: | |
collapse; border-spacing: 0; | |
} | |
td, th { | |
border: 1px solid transparent; /* No more visible border */ |
xrandr --newmode "1920x1080R" 138.50 1920 1968 2000 2080 1080 1083 1088 1111 +hsync -vsync
xrandr --addmode DP-1-1 1920x1080R
#!/bin/bash | |
# CREATE DEV ENVIRONMENT | |
echo "Setup dev env..." | |
sleep 1 | |
mkdir dev | |
cd dev | |
mkdir projects | |
mkdir utils | |
cd utils |
admin konvenciok
const kmeans = require('node-kmeans'); | |
let data = [ | |
{'category': 'szoke' , content: 'ket szoke no beszelget egy masik szoke novel'}, | |
{'category': 'szoke' , content: 'Egy szoke no bemegy az egyetemre'}, | |
{'category': 'szoke' , content: 'Egy szoke no bemegy az boltba'}, | |
{'category': 'allat' , content: 'A kutya elmegy setalni'}, | |
{'category': 'allat' , content: 'A medve meg a roka setal az erdoben'}, | |
{'category': 'allat' , content: 'Ket hernyo hernyoskodik'}, | |
{'category': 'zsido' , content: 'Ket zsido vesz egy hazat es egy autot'}, |
/** | |
Converted Bookmarklet (by https://mrcoles.com/bookmarklet): | |
javascript:(function()%7B(async%20function()%20%7B%24('.expcucc').remove()%3B%24('.c-challenges-item__exposure__meter__arrow').each(function(i)%20%7B%24(this).parent().parent().prepend('%3Cdiv%20class%3D%22expcucc%22%20style%3D%22position%3A%20absolute%3B%20right%3A%200%22%3EFetching...%3C%2Fdiv%3E')%3B%7D)%3B%24('.c-challenges-item__votes__total').each(function()%20%7B%24(this).text('...')%3B%7D)%3B%24('.c-challenges-item__photos__body').each(function(i)%20%7B%24(this).children().each(function(j)%20%7B%24(this).children('.c-challenges-item__photos__photo__votes').text('...')%3B%7D)%3B%7D)%3Bconst%20resp%20%3D%20await%20(await%20fetch('https%3A%2F%2Fgurushots.com%2Frest%2Fget_member_joined_active_challenges'%2C%20%7Bheaders%3A%20%7B'x-api-version'%3A%207%2C'x-env'%3A%20'WEB'%2C'x-requested-with'%3A%20'XMLHttpRequest'%2C'x-token'%3A%20((name)%20%3D%3E%20%7Bvar%20value%20%3D%20%22%3B%20%22%20%2B%20document.cookie%3Bvar%20parts%20%3D%20value.split( |
const googleTTS = require("google-tts-api"); | |
let mpv = require('node-mpv'); | |
const play = async (json) => { | |
let {text} = JSON.parse(json) | |
// text max length is 200 | |
text = text.substring(0, 199) | |
const url = googleTTS.getAudioUrl(text, { lang: "hu", slow: false, host: "https://translate.google.com" }) | |
const mpvPlayer = new mpv(); |