Skip to content

Instantly share code, notes, and snippets.

View sokol8's full-sized avatar
💭
hacking sport programming

Kostiantyn Sokolinskyi sokol8

💭
hacking sport programming
View GitHub Profile
@rednafi
rednafi / concurrent_hit.py
Last active March 19, 2024 12:52
1000 concurrent API request with ThreadPoolExecutor Python
import time
from concurrent.futures import ThreadPoolExecutor
from functools import wraps
import requests
from tqdm import tqdm
def timeit(method):
@wraps(method)
@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

@ruxi
ruxi / download_file.py
Last active February 3, 2024 18:56
python download_file with progressbar using request and tqdm
#!/usr/bin/env python
__author__ = "github.com/ruxi"
__license__ = "MIT"
import requests
import tqdm # progress bar
import os.path
def download_file(url, filename=False, verbose = False):
"""
Download file with progressbar
@tomysmile
tomysmile / mac-setup-redis.md
Last active May 23, 2024 03:17
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@rahul286
rahul286 / redis.md
Last active May 2, 2023 23:50
Useful redis cli commands

Redis Keys Count by Group (namespace)

redis-cli KEYS "*" | awk -F: '{print $1'} | sort | uniq -c

Count WordPress transient

redis-cli KEYS "*" | grep ":transient:" | wc -l
@mrliptontea
mrliptontea / sublime-text-3-windows-shortcuts.md
Last active June 15, 2024 16:22 — forked from TheShrike/gist:6111200
Sublime Text 3 - Useful Shortcuts (Windows)

Sublime Text 3 - Useful Shortcuts (Windows)

General

Shortcut Description
Ctrl+Shift+P command prompt
Ctrl+Alt+P switch project
Ctrl+P go to file
Ctrl+G go to line
@darktable
darktable / app.yaml
Created March 16, 2011 19:10
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest