Skip to content

Instantly share code, notes, and snippets.

View francjohny's full-sized avatar
I may be slow to respond.

Francis Johny francjohny

I may be slow to respond.
View GitHub Profile
This file has been truncated, but you can view the full file.
{
"user_name": "francjohny",
"num_solved": 5,
"num_total": 1772,
"ac_easy": 0,
"ac_medium": 4,
"ac_hard": 1,
"stat_status_pairs": [
{
"stat": {

Keybase proof

I hereby claim:

  • I am francjohny on github.
  • I am francjohny (https://keybase.io/francjohny) on keybase.
  • I have a public key ASCMcEh6DLMwuJWMRJCTGOr0QzVVtkENJC7jkY6eTLOJxQo

To claim this, I am signing this object:

@francjohny
francjohny / mass-insert.sh
Created April 29, 2018 08:23
Redis Mass Insertion Script - Alpine Linux
#!/usr/bin/env bash
readonly FILE=$1
readonly HOST=$2
cat ${FILE} | sed 's/\r*$/\r/' | redis-cli --pipe -h ${HOST}
@francjohny
francjohny / output.rpf
Created April 29, 2018 08:19
Redis Protocol Format
SET 2010566847.1467331947 "46086:1 1694648:1 6292312:1 15660534:1 16575220:1"
SET 1936063608.1517993381 "2291380:1 3725787:1 4933344:1 6292312:1 6546493:1 9095396:1 9935067:1 14626962:1"
SET 1393833803.1510927593 "3470466:1 4052252:1 5995142:1 7399404:1 9200825:1"
SET 713518138.1493451535 "5740820:1 6292312:1 7799743:1 11979496:1 14846115:1"
SET 47095656.1504222576 "1694648:1 3976538:1 4675610:1 5625712:1 6292312:1 15660534:1"
SET 1874315505.1399219524 "3550425:1 6292312:1 11009899:1 12721076:1 13969115:1 14608967:1 15028332:1 15160812:1 15660534:1"
SET 1000458376.1500994007 "4356791:1 5740820:1 6292312:1 13270591:1 13518007:1 14846115:1"
SET 372655160.1506863944 "3976538:1 4456253:1 10616631:1 13370087:1 14811345:1 16546085:1"
SET 961820179.1477566201 "2291380:1 3562366:1 4448115:1 4933344:1 6292312:1 6866025:1 8307051:1"
SET 1147230007.1353602453 "1694648:1 2281201:1 5440064:1 6292312:1 6344473:1 11140923:1 11774596:1 14568456:1 15660534:1"
@francjohny
francjohny / output.rpf
Created April 29, 2018 08:19
➜ head ouput.rpf| xxd - Mac OS
➜ head ouput.rpf| xxd
00000000: 5345 5420 3230 3130 3536 3638 3437 2e31 SET 2010566847.1
00000010: 3436 3733 3331 3934 3720 2234 3630 3836 467331947 "46086
00000020: 3a31 2031 3639 3436 3438 3a31 2036 3239 :1 1694648:1 629
00000030: 3233 3132 3a31 2031 3536 3630 3533 343a 2312:1 15660534:
00000040: 3120 3136 3537 3532 3230 3a31 220a 5345 1 16575220:1".SE
00000050: 5420 3139 3336 3036 3336 3038 2e31 3531 T 1936063608.151
00000060: 3739 3933 3338 3120 2232 3239 3133 3830 7993381 "2291380
00000070: 3a31 2033 3732 3537 3837 3a31 2034 3933 :1 3725787:1 493
00000080: 3333 3434 3a31 2036 3239 3233 3132 3a31 3344:1 6292312:1
@francjohny
francjohny / mass-insert.sh
Created April 29, 2018 08:17
Redis Mass Insertion Script - Mac OS
#!/usr/bin/env bash
readonly FILE=$1
readonly HOST=$2
perl -p -e 's|[\r\n]+|\r\n|g' ${FILE} | redis-cli --pipe -h ${HOST}
@francjohny
francjohny / output.rpf
Created April 29, 2018 08:17
➜ head ouput.rpf| xxd - Alpine Linux
➜ head ouput.rpf| xxd
00000000: 5345 5420 3230 3130 3536 3638 3437 2e31 SET 2010566847.1
00000010: 3436 3733 3331 3934 3720 2234 3630 3836 467331947 "46086
00000020: 3a31 2031 3639 3436 3438 3a31 2036 3239 :1 1694648:1 629
00000030: 3233 3132 3a31 2031 3536 3630 3533 343a 2312:1 15660534:
00000040: 3120 3136 3537 3532 3230 3a31 220a 5345 1 16575220:1".SE
00000050: 5420 3139 3336 3036 3336 3038 2e31 3531 T 1936063608.151
00000060: 3739 3933 3338 3120 2232 3239 3133 3830 7993381 "2291380
00000070: 3a31 2033 3732 3537 3837 3a31 2034 3933 :1 3725787:1 493
00000080: 3333 3434 3a31 2036 3239 3233 3132 3a31 3344:1 6292312:1