Skip to content

Instantly share code, notes, and snippets.

View dink10's full-sized avatar

Dmitry Kologrivov dink10

View GitHub Profile
@premitheme
premitheme / README.md
Last active March 23, 2024 22:08
Recover MAMP MySQL database using .frm and .ibd files after InnoDB crash

Recover MAMP MySQL database using .frm and .ibd files after InnoDB crash

After a power faliur (also can be a sudden restart or system crash), I ended up with corrupted database and lost the access to my local hosted websites for development. Even the MAMP's MySQL server was not starting.

Preparation

You will need to find the databases folders, in case of MAMP they are located in Applications/MAMP/db/mysql56 (or mysql57 depending on MySQL version).

You will find folders containing the database name, inside them you will find .frm and .ibd files. Take a copy of the entire folder for backup in another place, the desktop for example.

@davecheney
davecheney / go1.0-vs-go1.11.txt
Created October 7, 2018 11:13
test/bench/go1 benchmark results
name old time/op new time/op delta
BinaryTree17 5.44s ± 2% 3.27s ± 2% -39.90% (p=0.000 n=20+19)
Fannkuch11 4.95s ± 2% 2.68s ± 2% -45.87% (p=0.000 n=20+20)
FmtFprintfEmpty 142ns ± 2% 49ns ± 3% -65.39% (p=0.000 n=20+18)
FmtFprintfFloat 765ns ± 2% 260ns ± 2% -66.02% (p=0.000 n=20+20)
FmtFprintfInt 341ns ± 2% 95ns ± 2% -72.08% (p=0.000 n=19+20)
FmtFprintfIntInt 554ns ± 2% 150ns ± 1% -72.95% (p=0.000 n=20+19)
FmtFprintfPrefixedInt 497ns ± 3% 178ns ± 3% -64.12% (p=0.000 n=20+20)
FmtFprintfString 466ns ± 2% 86ns ± 3% -81.54% (p=0.000 n=20+20)
FmtManyArgs 2.23µs ± 2% 0.59µs ± 1% -73.46% (p=0.000 n=20+17)
@catlan
catlan / 01its-serverData.json
Last active May 10, 2024 15:03
https://itunes.apple.com/at/app/instagram/id389801252 X-Apple-Store-Front: 143445-2,32 apple-originating-system: MZStore
{
"storePlatformData": {
"product-dv-product": {
"results": {
"389801252": {
"artwork": [
{
"width": 170,
"height": 170,
"url": "https://is2-ssl.mzstatic.com/image/thumb/Purple118/v4/de/b9/5b/deb95b99-0b17-7713-9a0e-99344ebf4e55/Prod-1x_U007emarketing-85-220-0-5.png/170x170bb.png"
//
// Companion code to https://medium.com/statuscode/pipeline-patterns-in-go-a37bb3a7e61d
//
// To run:
// go get github.com/pkg/errors
// go run -race pipeline_demo.go
//
package main
@ahmetb
ahmetb / gcrgc.sh
Last active May 10, 2024 15:17
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@egorsmkv
egorsmkv / metrials-go.md
Last active May 23, 2024 17:04
Материалы по Go (golang): мануалы, статьи, книги и ссылки на сообщества

Материалы по Go (golang)

На русском языке

Мануалы и туториалы

  • [Введение в программирование на Go][1]
  • [Маленькая книга о Go][3]
  • [Эффективный Go][2]
  • Есть еще [Краткий пересказ Effective Go на русском языке][4], но 2009 года
@isidroamv
isidroamv / gz-reader.go
Last active March 13, 2024 11:48
Reading a txt gzip file with golang
func ReadGzFile(filename string) ([]byte, error) {
fi, err := os.Open(filename)
if err != nil {
return nil, err
}
defer fi.Close()
fz, err := gzip.NewReader(fi)
if err != nil {
return nil, err
@ursuad
ursuad / kafka-cheat-sheet.md
Last active March 14, 2024 10:32
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

@akurkin
akurkin / nested.sql
Last active October 23, 2023 07:05 — forked from alexey-milovidov/nested.txt
Example of Nested data type in ClickHouse.
:) CREATE TABLE test.nested (EventDate Date, UserID UInt64, Attrs Nested(Key String, Value String)) ENGINE = MergeTree(EventDate, UserID, 8192)
CREATE TABLE test.nested
(
EventDate Date,
UserID UInt64,
Attrs Nested(
Key String,
Value String)
) ENGINE = MergeTree(EventDate, UserID, 8192)
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/