Skip to content

Instantly share code, notes, and snippets.

View noherczeg's full-sized avatar

Norbert Csaba Herczeg noherczeg

View GitHub Profile
@noherczeg
noherczeg / find-and-kill-on-windows.txt
Created March 3, 2018 22:14
find processes and kill them on windows
> netstat -aon |find /i "listening" |find "8080"
> Taskkill /PID 1448 /F
$(document).on('change', '#clientupload', function () {
var x = document.getElementById("clientupload");
if ('files' in x) {
if (x.files.length > 0) {
//only one file accepted
for (var i = 0; i < 1; i++) {
var myFile = x.files[0];
var reader = new FileReader();
reader.readAsText(myFile);
reader.onload = function () {
var filename = "";
var type = xhr.getResponseHeader('Content-Type');
var blob = new Blob([response], {type: type});
var URL = window.URL || window.webkitURL;
var downloadUrl = URL.createObjectURL(blob);
if (filename) {
// use HTML5 a[download] attribute to specify filename
var a = document.createElement("a");
sudo apt-get --purge remove postgresql-*
sudo rm -Rf /etc/postgresql /var/lib/postgresql
sudo apt-get install postgresql
@noherczeg
noherczeg / ntp-fedora.txt
Created July 20, 2017 08:58
time server sync setup for fedora 24+
$ dnf -y install chrony
$ systemctl start chronyd
$ systemctl enable chronyd
$ firewall-cmd --add-service=ntp --permanent
$ firewall-cmd --reload
$ chronyc sources
210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
@noherczeg
noherczeg / composition.js
Created July 13, 2017 00:07 — forked from branneman/composition.js
OO JavaScript: Inheritance vs. Composition
//
// hasPosition trait
//
const hasPosition = state => ({
setPosition: function(x, y) {
this.x = x;
this.y = y;
}.bind(state)
});
@noherczeg
noherczeg / gfr
Created June 13, 2017 14:55
git reset to param branch
#!/bin/bash
branch=$1
echo "--------------------------------"
echo "Moving to branch: ${branch}"
echo "--------------------------------"
git fetch
git checkout $branch
sudo dnf update --nogpgcheck
watchOptions: {
aggregateTimeout: 10000,
ignored: [
/node_modules([\\]+|\/)+(?!@judo)/
]
},
# ....
sudo dnf install webkitgtk