Skip to content

Instantly share code, notes, and snippets.

View Eugeny's full-sized avatar

Eugene Eugeny

View GitHub Profile
@Eugeny
Eugeny / 1.sql
Created February 20, 2023 16:02
drop table if exists test;
set character_set_client = utf8mb4;
create table test (x varchar(1024) character set utf8mb4 COLLATE utf8mb4_general_ci) character set utf8mb4 COLLATE utf8mb4_general_ci;
insert into test values ("👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍
@Eugeny
Eugeny / MatContextMenuTrigger.ts
Created February 16, 2023 16:12
Angular Material context menu trigger
import { ConnectedPosition, FlexibleConnectedPositionStrategy } from '@angular/cdk/overlay'
import { Directive, HostListener, Input } from '@angular/core'
import { MatMenuPanel, _MatMenuTriggerBase } from '@angular/material/menu'
import { fromEvent, merge } from 'rxjs'
// @Directive declaration styled same as matMenuTriggerFor
// with different selector and exportAs.
@Directive({
selector: `[matContextMenuTriggerFor]`,
@Eugeny
Eugeny / 1.ts
Last active February 14, 2023 15:28
// -----------
// Challenge 0
// -----------
// function F<T> (f: ???): Promise<T> {
// return new Promise(f)
// }
// -----------
// Challenge 1
diff --git a/apps/cloud/serializers.py b/apps/cloud/serializers.py
index 15e6dd28a..433de2006 100644
--- a/apps/cloud/serializers.py
+++ b/apps/cloud/serializers.py
@@ -19,7 +19,7 @@ class CloudConnectionSerializer(ModelSerializer):
class ClickGallerySerializer(Serializer):
- id = fields.IntegerField()
+ id = fields.IntegerField(read_only=True)
diff --git a/apps/cloud/serializers.py b/apps/cloud/serializers.py
index 15e6dd28a..433de2006 100644
--- a/apps/cloud/serializers.py
+++ b/apps/cloud/serializers.py
@@ -19,7 +19,7 @@ class CloudConnectionSerializer(ModelSerializer):
class ClickGallerySerializer(Serializer):
- id = fields.IntegerField()
+ id = fields.IntegerField(read_only=True)
#/bin/bash
rm -rf /Library/Application\ Support/Avid/
rm -rf /private/var/log/Avid
rm -rf /private/var/root/AvidEditorMediaServices
rm -rf "/Library/Application Support/Avid"
rm -rf /Library/Caches/Avid
rm -rf /Library/Logs/Avid
rm -rf "/Users/Shared/TranscodeServiceWorker/Avid FatalErrorReports"
rm -rf /Library/Logs/DiagnosticReports/AvidMediaComposer*
rm -rf /Library/Extensions/AvidDX.kext
@Eugeny
Eugeny / embed.rs
Last active March 27, 2022 12:39
Poem endpoint for rust-embed
//! Usage:
//!
//! ```
//! #[derive(RustEmbed)]
//! #[folder = "app/dist"]
//! pub struct Assets;
//!
//! Route::new()
//! .at("/", EmbeddedFileEndpoint::<Assets>::new("index.html"))
//! .nest_no_strip("/assets", EmbeddedFilesEndpoint::<Assets>::new())
<?xml version="1.0" encoding="utf-8"?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0">
<serviceStateTable>
<stateVariable>
<name>TransportState</name>
<sendEventsAttribute>no</sendEventsAttribute>
<dataType>string</dataType>
<allowedValueList>
<allowedValue>STOPPED</allowedValue>
<allowedValue>PLAYING</allowedValue>
{
"event_id": "d6c9e464c61841e18b035cad403acf15",
"project": 181876,
"release": "1.0.139",
"dist": null,
"platform": "javascript",
"message": "",
"datetime": "2021-12-15T01:53:15.157000Z",
"tags": [
[
export const autofocus = /* @ngInject */ $timeout => ({
restrict: 'A',
link (_$scope, element) {
$timeout(() => element[0].focus())
},
})