Skip to content

Instantly share code, notes, and snippets.

View yakimka's full-sized avatar
💭
import __hello__

yakimka

💭
import __hello__
View GitHub Profile
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
The Snowball stemmer.
Pavel Perestoronin © 2013
"""
import re
import unittest
@marians
marians / CouchDB_Python.md
Last active June 14, 2025 02:00
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.

Installation

pip install couchdb

Importing the module

@Ellrion
Ellrion / LoggingServiceProvider.php
Last active February 5, 2019 16:53
Multiple logging (pool of loggers) for Laravel
<?php namespace App\Providers;
use App\Services\Log\WritersPool;
use Illuminate\Support\ServiceProvider;
use Monolog\Handler\RavenHandler;
use Psr\Log\LogLevel;
class LoggingServiceProvider extends ServiceProvider
{
public function boot()
Verb URI Action Route Name View Policy Middleware
GET /resources index resources.index resources.list list can:list,Resource::class
GET /resources/create create resources.create resources.create create can:create,Resource::class
POST /resources store resources.store create can:create,Resource::class
GET /resources/{resource} show resources.show resources.show view can:view,resource
GET /resources/{resource}/edit edit resources.edit resources.edit update can:update,resource

|

@butla
butla / wait_for_tcp_port.py
Last active December 8, 2022 19:52
Waiting for a TCP port to start accepting connections (Python >=3.6)
"""
MIT License
Copyright (c) 2017 Michał Bultrowicz
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
@Ellrion
Ellrion / LaravelUserProcessor.php
Last active February 5, 2019 16:53
Add info about auth user for log in Laravel
<?php
namespace App\Services\Foundation\Log;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Jsonable;
/**
@roycewilliams
roycewilliams / pwnedpasswords-v2-top20k.txt
Last active January 4, 2025 03:16
pwnedpasswords-v2-top20k.txt
#------------------------------------------------------------------------------
# Top 20K hashes from the Troy Hunt / haveibeenpwned Pwned Passwords list v2 (2018-02-21)
# with frequency count and cracked plaintext passwords
#
# The latest version of this file can be found here:
# https://gist.github.com/roycewilliams/281ce539915a947a23db17137d91aeb7
#
# NOTE: THIS FILE IS DEPRECATED.
# The equivalent of this file, but based on v6 of the Pwned Passwords, is here:
# https://gist.github.com/roycewilliams/226886fd01572964e1431ac8afc999ce
@noviluni
noviluni / admin.py
Last active February 4, 2025 12:30 — forked from safar/admin.py
Large Table Paginator for Django: Scale Django admin pages and avoid timeouts.
from django.contrib.admin import ModelAdmin
from .paginator import LargeTablePaginator
class MyTableAdmin(ModelAdmin):
...
paginator = LargeTablePaginator
show_full_result_count = False # Recommended to avoid another count()
...
@SeanHood
SeanHood / README.md
Last active March 18, 2025 13:29
Vendoring Python dependencies for the lazy

Vendoring Python dependencies for the lazy

Say I've written a script in Python and want to ship the whole thing in a single directory/tarball to a machine without having to polute the system by running pip or yum. This is a way to do that.

# Install deps into a directory called vendor
pip install -r requirements.txt --prefix vendor