Skip to content

Instantly share code, notes, and snippets.

View gngeorgiev's full-sized avatar
🦀

Georgi N. Georgiev gngeorgiev

🦀
View GitHub Profile
@gngeorgiev
gngeorgiev / color.py
Last active December 22, 2023 16:44
opencv hell
import numpy as np
import cv2
def color(img):
imageFrame = cv2.resize(img, (0, 0), None, 0.2, 0.2)
# Convert the imageFrame in
# BGR(RGB color space) to
# HSV(hue-saturation-value)
# color space
@gngeorgiev
gngeorgiev / docker-self-cert.sh
Created August 2, 2022 22:55 — forked from vmatekole/docker-self-cert.sh
Secure your Docker socket with TLS/SSL
#!/bin/bash
# Generate self-cert certificates for Docker socket. I have tried many tutorials including http://tech.paulcz.net/2016/01/secure-docker-with-tls/
# None worked... So I took the official steps from Docker docs - https://docs.docker.com/engine/security/https/ and placed them
# in a script. Please ensure that you replace the IP addresses/DNS names denoted in X with IP's and hostnames you wish to allow
# to connect with your daemon, normally 127.0.0.1 is always required and the hostname of your server. If you have a coreos cluster
# placing IP's and hostnames of each node maybe preferable over creating unique certs for each node.
# This script does not cover the steps for copying your certs to the relevant locations, as per the following document - https://docs.docker.com/engine/security/https/
# 1. In our production setup we copy server.key, server-cert.pem and ca-cert.pem to /etc/docker/ssl
# 2. Client certs(ca.pem,cert.pem,key.pem) are copied to user dir in our case user core - /home/core/.docker/
@gngeorgiev
gngeorgiev / alacrity.yml
Created March 1, 2020 21:25 — forked from irfn/alacrity.yml
alacrity config
env:
TERM: xterm-256color
window:
dimensions:
columns: 80
lines: 24
padding:
x: 2
@gngeorgiev
gngeorgiev / pdf.js
Created January 30, 2018 21:06
pdf
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://news.ycombinator.com', {waitUntil: 'networkidle2'});
await page.pdf({path: 'hn.pdf', format: 'A4'});
await browser.close();
})();
@gngeorgiev
gngeorgiev / parse-installation-cloud-code.js
Created January 29, 2018 16:23
Parse Installation deduplication - Cloud Code
Parse.Cloud.beforeSave(Parse.Installation, function(request, response) {
var androidId = request.object.get("androidId");
if (!androidId) {
console.warn("No androidId found, save and exit");
return response.success();
}
var query = new Parse.Query(Parse.Installation);
query.equalTo("androidId", androidId);
query.ascending("createdAt");
@gngeorgiev
gngeorgiev / parse-installation.java
Last active January 29, 2018 16:17
Parse Installation deduplication - android
//First: get the ANDROID_ID
String android_id = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);
Parse.initialize(this, "APP_ID", "CLIENT_KEY");
//Now: add ANDROID_ID value to your Installation before saving.
ParseInstallation.getCurrentInstallation().put("androidId", android_id);
ParseInstallation.getCurrentInstallation().saveInBackground();
@gngeorgiev
gngeorgiev / cloud-code.md
Created November 24, 2017 22:20
cloud-code.md
Telerik Platform SashiDo and Parse Server
Cloud Code for Data Triggers
Cloud Functions Cloud Functions
Scheduled Jobs Cloud Jobs
Stored Procedures N/A
N/A Webhooks
@gngeorgiev
gngeorgiev / features.md
Last active November 24, 2017 22:23
features.md
Telerik Platform SashiDo and Parse Server
Type-Level permissions Class-level permissions
Item-Level permissions Object-Level access control
Roles content type Role collection
Users content type User collection
Devices content type Installation collection
Relations Relations and Pointers
Images Images
@gngeorgiev
gngeorgiev / fields.md
Last active November 24, 2017 23:05
fields.md
Telerik Platform SashiDo and Parse Server
Id id
ModifiedAt updatedAt
CreatedAt createdAt
CreatedBy configured with ACL
Owner configured with ACL
ModifiedBy N\A
@gngeorgiev
gngeorgiev / not-supported
Created November 24, 2017 19:10
not-supported
_ _ _ ____ _ _
| \ | | ___ | |_ / ___| _ _ _ __ _ __ ___ _ __| |_ ___ __| |
| \| |/ _ \| __| \___ \| | | | '_ \| '_ \ / _ \| '__| __/ _ \/ _` |
| |\ | (_) | |_ ___) | |_| | |_) | |_) | (_) | | | || __/ (_| |
|_| \_|\___/ \__| |____/ \__,_| .__/| .__/ \___/|_| \__\___|\__,_|
|_| |_|