Skip to content

Instantly share code, notes, and snippets.

View tripolskypetr's full-sized avatar
💻
Frontend dev fueled by a passion for UI/UX and art, design

Petr Tripolsky tripolskypetr

💻
Frontend dev fueled by a passion for UI/UX and art, design
View GitHub Profile
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active May 1, 2024 21:12
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@enijar
enijar / image-cache.js
Created October 31, 2018 08:46
IndexedDB Cache Images
class Cache {
constructor(props = {}) {
this.version = props.version || 1;
this.assets = {};
this.db = null;
}
init() {
return new Promise(resolve => {
const request = indexedDB.open('tactics.cache', this.version);
@danielhanold
danielhanold / dkc-batch.sh
Last active November 3, 2023 13:51
Run multiple docker-compose files at once
#!/bin/bash
# @file
# If an application is comprised of multiple docker-compose.yml files, this file
# allows you to execute docker-compose commands for all files in a batch.
# For this to work, place this file into a directory and place each
# docker-compose environment in a subdirectory.
#
# Example:
# /maindir
@harish2704
harish2704 / lodash.get.js
Last active June 3, 2023 23:41
Simple lodash.get function in javascript
/* Implementation of lodash.get function */
function getProp( object, keys, defaultVal ){
keys = Array.isArray( keys )? keys : keys.split('.');
object = object[keys[0]];
if( object && keys.length>1 ){
return getProp( object, keys.slice(1) );
}
return object === undefined? defaultVal : object;
}
@renaudtertrais
renaudtertrais / zip.js
Created July 5, 2016 13:59
A simple ES6 zip function
const zip = (arr, ...arrs) => {
return arr.map((val, i) => arrs.reduce((a, arr) => [...a, arr[i]], [val]));
}
// example
const a = [1, 2, 3];
const b = [4, 5, 6];
const c = [7, 8, 9];
@remojansen
remojansen / class_decorator.ts
Last active September 14, 2023 14:54
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@codebrainz
codebrainz / license.txt
Last active March 6, 2024 00:14
MJPEG Player in JavaScript
Copyright 2015 Matthew Brush
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@JacobHsu
JacobHsu / redis_list.js
Last active January 16, 2023 15:54
#nodejs redis list rpush lpush brpop blpop
var redis = require('redis'),
client = redis.createClient();
var arr = ["some val","some val2","some val3"];
//Use multi() to pipeline multiple commands at once
var multi = client.multi();
for (var i=0; i<arr.length; i++) {
//console.log(arr[i]);
//將一個或多個值value插入到列表key的表尾。
@elidickinson
elidickinson / max_width_email.html
Created May 6, 2013 15:10
Email Template trick: max-width with outlook
<!--[if mso]>
<center>
<table><tr><td width="580">
<![endif]-->
<div style="max-width:580px; margin:0 auto;">
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>
@EyalAr
EyalAr / hello_world_opencv.cpp
Created October 23, 2012 18:37
Hello World in OpenCV
#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"
using namespace cv;
int main(int argc, char** argv) {
//create a gui window:
namedWindow("Output",1);