Skip to content

Instantly share code, notes, and snippets.

View proteye's full-sized avatar
🏠
Working from home

Ramil Zaynetdinov proteye

🏠
Working from home
View GitHub Profile
@jo
jo / js-crypto-libraries.md
Last active January 16, 2025 12:08
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@ziizii
ziizii / rsa.dart
Last active August 13, 2018 08:33
How to generate RSA private/public key pair in Dart with Pointy Castle
import 'dart:html';
import 'dart:math';
import 'dart:typed_data';
import "package:bignum/bignum.dart";
import "package:pointycastle/export.dart";
void main() {
var keyParams = new RSAKeyGeneratorParameters(new BigInteger("65537"), 2048, 5);
@zmts
zmts / tokens.md
Last active April 18, 2025 15:23
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@tomasevich
tomasevich / nginx_nodejs.md
Last active September 17, 2024 17:17
Сервер в связке Nginx + NodeJs

Сервер в связке Nginx + NodeJs

Данная пошаговая инструкция поможет освоить основы на простом примере

Для справки

Сервер поднимался на Debian 8 c характеристиками:

CPU - 1 ядро x 500 МГц

@tvaliasek
tvaliasek / main.js
Created June 5, 2018 20:09
electron axios stream download with progress
import {ipcMain} from 'electron'
const fs = require('fs')
const axios = require('axios')
/* ... */
ipcMain.on('downloadFile', function (event, data) {
const filePath = data.filePath
const item = data.item
@proteye
proteye / aes_encryption_helper.dart
Created September 5, 2018 10:54
How to AES-256 (CBC/CFB mode) encrypt and decrypt in Dart/Flutter with Pointy Castle
import 'dart:convert';
import 'dart:typed_data';
import "package:pointycastle/export.dart";
import "./convert_helper.dart";
// AES key size
const KEY_SIZE = 32; // 32 byte key for AES-256
const ITERATION_COUNT = 1000;
@putraxor
putraxor / raw_keyboard_widget.dart
Created July 1, 2019 22:50
Flutter widget to handle keyboard for CTRL+C/V/X/A and SHIFT+LEFT/RIGHT selection
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class RawKeyboardWidget extends StatefulWidget {
final Widget child;
RawKeyboardWidget({@required this.child});
@override
@dhruvilp
dhruvilp / main.dart
Last active April 21, 2023 14:05
TextField AutoComplete (using Overlay)
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@PlugFox
PlugFox / app_observer.dart
Last active September 14, 2024 09:32
AppObserver implements BlocObserver
import 'dart:async';
import 'package:firebase_analytics/firebase_analytics.dart'
show FirebaseAnalytics;
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:l/l.dart' show L, LogMessage, LogLevel;
///import 'package:.../src/utils/mobile_crashlytics.dart';
import 'package:meta/meta.dart' show required, immutable;
import 'package:platform_info/platform_info.dart';
@donfour
donfour / App.tsx
Last active December 15, 2023 02:12
Sample Editor.js plugin in React
import EditorJs from "react-editor-js";
import SimpleImage from "./SimpleImage";
const App = () => {
return (
<EditorJs
tools={{
simpleImage: SimpleImage,
}}
/>