Skip to content

Instantly share code, notes, and snippets.

{
"data": [
{"name": "one", "value": 1},
{"name": "two", "value": 2}
]
}
@chudnyi
chudnyi / App.tsx
Last active February 22, 2022 11:59
Deno SSR React App config with working import-map.json
import React from 'react';
export const App = (props: {}) => {
return (
<h1>
Hello from React
</h1>
);
};
@chudnyi
chudnyi / my-dev-tools.js
Last active December 2, 2021 08:23
Инструменты для отладки
export function myDevTool02() {
console.log("🔆 Hello from myDevTool02 with JS");
}
@chudnyi
chudnyi / rm_node_modules.md
Last active October 3, 2022 14:28
Remove node_modules folder recursively from a specified path using command line

Найти все папки node_modules в текущей папке

find . -name 'node_modules' -type d -prune -print

Удалить все папки node_modules в текущей папке

find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
@chudnyi
chudnyi / react-lifecycle-cheatsheet.md
Created April 19, 2019 10:30 — forked from bvaughn/react-lifecycle-cheatsheet.md
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
@chudnyi
chudnyi / metro.config.js
Created April 15, 2019 08:57 — forked from mbret/metro.config.js
Symlink for React Native 0.59 (symlink + scoped package + hast name collision)
/* eslint no-useless-escape: 0 */
/* eslint max-len: 0 */
/**
* For more info regarding metro config:
* @see https://facebook.github.io/metro/docs/en/configuration
*/
const path = require("path");
const fs = require("fs");
// Get blacklist factory
@chudnyi
chudnyi / pin256.sh
Created April 12, 2019 12:45 — forked from 0xced/pin256.sh
Extract certificate + public key + pin from a TLS server
#!/usr/bin/env bash -e
HOST=${1:-cloudflare.com}
FILENAME=${2:-${HOST%%.*}}
# For file naming, see https://support.ssl.com/Knowledgebase/Article/View/19/0/der-vs-crt-vs-cer-vs-pem-certificates-and-how-to-convert-them
# For HTTP Public Key Pinning (HPKP), see https://developer.mozilla.org/en-US/docs/Web/HTTP/Public_Key_Pinning
CERTIFICATE_PEM="${FILENAME}_certificate.ascii.crt"
CERTIFICATE_DER="${FILENAME}_certificate.crt"
PUBKEY_PEM="${FILENAME}_pubkey.ascii.key"
@chudnyi
chudnyi / android adb-waiting-for-devices-on-windows.md
Last active April 10, 2019 15:27
Android adb waiting for devices on windows #android #adb #logs

✅ Reboot wndows

Restart adb server

  1. adb kill-server
  2. adb start-server
  3. adb devices
  4. adb logcat

Reset Authorize Device

@chudnyi
chudnyi / ViewController.Swift
Created April 9, 2019 06:45 — forked from cscouto/ViewController.Swift
SWIFT - Observe contentSize fro the tableView
class ViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var heightTableView: NSLayoutConstraint!
override func viewDidLoad() {
super.viewDidLoad()
tableView.addObserver(self, forKeyPath: "contentSize", options: .new, context: nil)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
@chudnyi
chudnyi / Mobile-App-Remote-Logging.md
Last active April 3, 2019 18:50
Mobile App Remote Logging