Skip to content

Instantly share code, notes, and snippets.

View studentIvan's full-sized avatar
🎯
Focusing

Ivan Maslov | JavaScript & Web Performance Enthusiast studentIvan

🎯
Focusing
View GitHub Profile
@studentIvan
studentIvan / mongo_db_recover_delete_record-2.4.py
Created August 4, 2017 10:15 — forked from guss77/mongo_db_recover_delete_record-2.4.py
Try to recover deleted documents from a mongodb 2.4 data file. Based on https://gist.github.com/egguy/2788955 with help from https://yazadk.wordpress.com/2015/07/15/a-forensic-perspective-on-recovering-deleted-data-from-big-data-systems/#MongoDB . Make sure to change `decode_chunk` so it properly detects the objects you are trying to recover - i…
#!/usr/bin/python
"""A little script to recover deleted recording of a mongoDB db file
There's no optimization but it work and has saved me
"""
import struct
import bson
import pymongo
@studentIvan
studentIvan / package.json
Last active March 5, 2018 16:02
Translation react script for plugin babel-plugin-jsx-i18n-tag-translate-replacer and transifex
{
"scripts": {
"script:translations:pull": "BABEL_ENV='node' babel-node util/translations/translations.script.js pull",
"script:translations:generate": "BABEL_ENV='node' babel-node util/translations/translations.script.js generate"
},
"dependencies": {
"babel-plugin-jsx-i18n-tag-translate-replacer": "github:studentIvan/babel-plugin-jsx-i18n-tag-translate-replacer",
"transifex-api-es6": "github:studentIvan/transifex-api-es6#fix-deps"
}
}
import { canRoute, customHistory, routeTo } from './preact-router.local';
import { appRegistry, eventsService } from '../../../services/service-manager';
/**
* Local setURL function overwrite from preact-router
*
* @param {string} url url, applied to router
* @param {string} type optional operation name, default = push
* @param {{ realURL: string, displayURL: string }} newState state object
*/
@studentIvan
studentIvan / device.service.js
Last active August 16, 2018 16:09
Device service javascript helper
/* global window, location, navigator, Element */
/* eslint comma-dangle: "off", no-prototype-builtins: "off", no-param-reassign: "off" */
/**
* device service
* @version 2.0.1
*/
module.exports = {
cache: {},
/**
/**
* simple memoize registry
*/
const ApplicationRegistry = {
instance: Object.create(null),
getInstance() {
return this.instance;
},
};
@studentIvan
studentIvan / bash commands (one by one)
Last active January 16, 2019 11:32
net::ERR_CERT_AUTHORITY_INVALID chrome solution for mac os mojave, ssl errors fix for https://localhost
openssl genrsa -des3 -passout pass:x -out localhost.pass.key 2048
openssl rsa -passin pass:x -in localhost.pass.key -out localhost.key
rm localhost.pass.key
openssl req -new -key localhost.key -out localhost.csr -config $(pwd)/openssl.cnf -subj "/C=SW/ST=Gothenburg/L=localhost/O=Ridestore/OU=localhost/CN=localhost/[email protected]/subjectAltName=DNS.1=localhost/"
openssl x509 -req -days 365 -in localhost.csr -signkey localhost.key -out localhost.crt -extfile v3.ext
--c--- get multiplier from things todo object
on getMultiplierFromToDo(theToDo, defaultMultiplierValue)
local theToDo
set toDoName to name of theToDo
set multiplier to second character of toDoName
set multiplierBefore to first character of toDoName
set multiplierAfter to third character of toDoName
set isValidMultiplier to ((multiplierBefore is equal to "[") and (multiplierAfter is equal to "]"))
set multiplierValue to defaultMultiplierValue
if isValidMultiplier then set multiplierValue to multiplier as real
/* eslint-disable */
var loaderUtils = require('loader-utils');
/**
* getLocalIdent function for preact-css-modules
* do (null, null, className) for manual use
*/
var getLocalIdent = (context, localIdentName, localName, options) => {
var result = localName;
/** exclude some classNames */
@studentIvan
studentIvan / cloudSettings
Last active May 12, 2020 11:51
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-12T11:51:27.444Z","extensionVersion":"v3.4.3"}
@studentIvan
studentIvan / instructions.txt
Last active May 21, 2020 18:36
Fast solution to replace the node-spdy package using with the express.js on the node v12. Development purposes only!
1. npm uninstall spdy
2. npm install http2-proxy finalhandler
3. replace the code
import spdy from 'spdy';
spdy.createServer(HTTP2_OPTIONS, app).listen(HTTP2_PORT, (error) => { ...
with