Skip to content

Instantly share code, notes, and snippets.

vladignatyev /
Last active November 23, 2022 01:00
Save Python dict to Redis hash
def dict_to_redis_hset(r, hkey, dict_to_store):
Saves `dict_to_store` dict into Redis hash, where `hkey` is key of hash.
>>> import redis
>>> r = redis.StrictRedis(host='localhost')
>>> d = {'a':1, 'b':7, 'foo':'bar'}
>>> dict_to_redis_hset(r, 'test', d)
>>> r.hgetall('test')
vladignatyev /
Created November 24, 2014 18:33
Generate pretty random team names for World's First Global Hackathon teams using Enchant for english words suggestion
import enchant
import random
_EN_ALPHABET = map(chr, range(97, 123))
_NUMBERS = map(str, range(0, 9))
class Names(object):
def __init__(self, character_set=tuple(_NUMBERS + _EN_ALPHABET)):
self.characters = character_set
vladignatyev /
Last active October 29, 2023 16:36
Python command line progress bar in less than 10 lines of code.
# The MIT License (MIT)
# Copyright (c) 2016 Vladimir Ignatev
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software
# is furnished to do so, subject to the following conditions:
vladignatyev /
Created July 26, 2015 18:10
Remove files and directories older than 7 days
find . -mtime +7 -exec rm -rf {} \;
vladignatyev / Emscripten Installation on OS X El Capitan
Last active October 3, 2017 07:22
Emscripten: Installation and running on OS X. Workaround for "Cannot find /usr/bin/llvm-link", "could not check fastcomp", "LLVM version appears incorrect (seeing "7.0", expected "3.7")"
View Emscripten Installation on OS X El Capitan
vladignatyev / APAnalyticsTracker.h
Last active March 28, 2016 17:24
Add Google Analytics into XCode project for iOS, resolving "use of '@import' when modules are disabled” error
View APAnalyticsTracker.h
// APAnalyticsTracker.h
#import <Foundation/Foundation.h>
@interface APAnalyticsTracker : NSObject
+ (void)configureTracker;
+ (void)trackScreenWithName: (NSString*) name;
vladignatyev /
Last active February 2, 2017 11:26
The example code to check the problem in a question problem, posted on StackOverflow
# See:
import sys
import pandas as pd
import gc
# @profile ## uncomment this line if you want to profile with memory-profiler Python's module
def make_list():
pd_arr = []
for i in range(0,10000):
vladignatyev / Top Bitcoin Dice
Last active November 17, 2023 10:10
Top Bitcoin Dice Games
View Top Bitcoin Dice

Top Bitcoin Dice Games

Curated list of the best Bitcoin Dice games is here. It seems that you're up to play and to win real Bitcoins, but please cool down for a moment and read the notice before you start.

Read before play Bitcoin dice games

This page contains a curated list of awesome Bitcoin betting games that pay. Every game presented has a faucet, so you can claim some free Bitcoins to try the game before actually making your first deposit.

Games listed here, are proven to pay: every game has separate support thread on Bitcointalk forum and pretty huge community behind it. Also, every game listed here is provably fair. It means, that you can test

vladignatyev / ListAdapter.kt
Created May 21, 2018 12:50
Kotlin + Anko + ButterKnife: helper for async adapter for ListView
View ListAdapter.kt
package com.github.kotlin.lib
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter
import butterknife.ButterKnife
vladignatyev / testdevice.js
Created May 27, 2018 13:51
Get hardware data from Browser to implement vendor and hardware lock like Google and other shit companies do
View testdevice.js
console.log("CPU/OS: " + navigator.oscpu);
console.log("Cores count: " + navigator.hardwareConcurrency);
console.log("RAM: " + navigator.deviceMemory);
console.log("Plaform: " + navigator.platform);
console.log("Browser info: " + navigator.userAgent);
console.log("Browser info: " + navigator.product + " " + navigator.productSub);
console.log("Browser info: " + navigator.appCodeName);
console.log("Browser info: " + navigator.appName);
console.log("Browser info: " + navigator.appVersion);
console.log("Vendor: " + navigator.vendor + " " + navigator.vendorSub);