Skip to content

Instantly share code, notes, and snippets.

View ZhukovAlexander's full-sized avatar
:octocat:

Alexander Zhukov ZhukovAlexander

:octocat:
View GitHub Profile
@A-gambit
A-gambit / REACTIVE2016-LIGHTNING-PROPOSAL.md
Last active February 22, 2024 18:24
Proposal for lightning talk at ReactiveConf 2016: Road from UndefinedLand

Proposal for a lightning talk at the Reactive 2016.

Keep calm and like/retweet it on Twitter and star this Gist to vote on this talk.

Road from UndefinedLand

Undefiend

I work at Grammarly. We like React and happily use it in our applications. However, sometimes something goes wrong and bugs creep into the code. Here comes testing. It helps make us confident about the quality of our code.

Creating a redis Module in 15 lines of code!

A quick guide to write a very very simple "ECHO" style module to redis and load it. It's not really useful of course, but the idea is to illustrate how little boilerplate it takes.

Step 1: open your favorite editor and write/paste the following code in a file called module.c

#include "redismodule.h"
/* ECHO <string> - Echo back a string sent from the client */
int EchoCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
@dlebech
dlebech / cache.py
Created March 20, 2016 16:51
Python LRU cache that works with coroutines (asyncio)
"""Global LRU caching utility. For that little bit of extra speed.
The caching utility provides a single wrapper function that can be used to
provide a bit of extra speed for some often used function. The cache is an LRU
cache including a key timeout.
Usage::
import cache
@cache.memoize
@jeremypruitt
jeremypruitt / sns-publish
Last active August 19, 2022 18:09
AWS Lambda function to publish to SNS topic
console.log('Loading function');
var AWS = require('aws-sdk');
AWS.config.region = 'us-west-2';
exports.handler = function(event, context) {
console.log("\n\nLoading handler\n\n");
var sns = new AWS.SNS();
sns.publish({
@rxaviers
rxaviers / gist:7360908
Last active April 19, 2024 10:02
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@audreyfeldroy
audreyfeldroy / pypi-release-checklist.md
Last active February 23, 2023 15:03
My PyPI Release Checklist
  • Update HISTORY.md
  • Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 18, 2024 10:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@hrldcpr
hrldcpr / tree.md
Last active April 15, 2024 15:27
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!