Skip to content

Instantly share code, notes, and snippets.

View mjzarrin's full-sized avatar
🏠
Working from home

Ario Zarrin mjzarrin

🏠
Working from home
View GitHub Profile
@fearblackcat
fearblackcat / proxy_for_terminal.md
Last active April 13, 2024 18:53
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@kgantsov
kgantsov / large_file_server.py
Created April 14, 2017 11:18
Example of serving large files using aiohttp server without reading entire file into a memory
import asyncio
import os
from aiohttp import web
from aiohttp import streamer
@streamer
async def file_sender(writer, file_path=None):
"""
Validation.add('IsEmpty', '', function(v) {
return (v == '' || (v == null) || (v.length == 0) || /^\s+$/.test(v)); // || /^\s+$/.test(v));
});
Validation.addAllThese([
['validate-select', 'Please select an option.', function(v) {
return ((v != "none") && (v != null) && (v.length != 0));
}],
['required-entry', 'This is a required field.', function(v) {
return !Validation.get('IsEmpty').test(v);
@reyjrar
reyjrar / elasticsearch.yml
Last active May 12, 2023 11:58
ElasticSearch config for a write-heavy cluster
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing