Skip to content

Instantly share code, notes, and snippets.

@korczis
korczis / removeDuplicates.js
Created November 22, 2013 11:47
JavaScript implementation of function for removing duplicate items from array
function removeDuplicates(vals) {
var res = [];
var tmp = vals.sort();
for (var i = 0; i < tmp.length; i++) {
res.push(tmp[i]);
while (JSON.stringify(tmp[i]) == JSON.stringify(tmp[i + 1])) {
i++;
}
}
@korczis
korczis / getBrowserPlugins.js
Last active July 24, 2020 12:55
Detect Plugins installed in Browser JSFiddle http://jsfiddle.net/enB3B/
// See JSFiddle
http://jsfiddle.net/enB3B/
var getBrowserPlugins = function(navigator) {
var rdls = function (vals) {
var res = [];
var tmp = vals.sort();
for (var i = 0; i < tmp.length; i++) {
function CheckAdobeVersion() {
var isInstalled = false;
var version = null;
if (window.ActiveXObject) {
var control = null;
try {
// AcroPDF.PDF is used by version 7 and later
control = new ActiveXObject('AcroPDF.PDF');
} catch (e) {
// Do nothing
@korczis
korczis / nginx.conf
Created November 27, 2013 12:39
Configuration of HTTPS thescratch.io
proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=cache:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_the_scratch {
server 127.0.0.1:3000 weight=1 fail_timeout=60s;
}
# the nginx server instance
server {
@korczis
korczis / architecture.dot
Last active August 23, 2016 17:00
Architecture in Graphviz
// dot.exe -T svg -o architecture.svg architecture.dot
digraph architecture {
// Render chart with left to right layout
rankdir="LR";
// AMQP communication node
amqp [label="AMQP",shape=box,fillcolor="burlywood",style="filled"];
// Clients
@korczis
korczis / architecture.svg
Created December 2, 2013 12:28
SVG output for achitecture.dot
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@korczis
korczis / architecture2.svg
Created December 2, 2013 13:17
Advanced Architecture Chart Using Dot/Graphviz Output SVG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
a 9
a 8
a 12
a 11
aaa 18
ac 13
af 13
as 15
at 11
b 7
(function () {
"use strict;"
var deferred = require('deferred');
var pockejDesetSekund = function() {
var d = deferred();
setTimeout(function() {
var result = 42;
@korczis
korczis / git-create-empty-branch.md
Last active January 23, 2016 05:53
Git - Create empty branch

Show SHA of initial commit

$ git rev-list HEAD | tail -n 1
eae879bda573ea5d02573e5179307b84e6c333ec

Create new branch from initial commit

$ git checkout -b loader eae879bda573ea5d02573e5179307b84e6c333ec
Switched to a new branch 'loader'