Skip to content

Instantly share code, notes, and snippets.

@wildcard
wildcard / ya.py
Last active April 12, 2024 13:23 — forked from Yegorov/ya.py
Download file from Yandex.Disk through share link for large file + reconnect option on MacOS with caffeinate to prevent computer from sleep
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# https://toster.ru/q/72866
# How to
# wget http://gist.github.com/...
# chmod +x ya.py
# ./ya.py download_url path/to/directory
import os, sys, json
Добавить в начале строки Найти ^ Заменить 0;
^\W пробел в начале строки
\d{8} найти 8 цыфр подряд
^\d{4};92 найти В НАЧАЛЕ ЧЕТЫРЕХзначные числа после которы есть ;92
[^=]*$ любые символы, кроме "="
;(.*) все после ;
(\b\S+\b)(?=.*\1) повторение на строке
\d [0-9] Цифровой символ
@Tushar-N
Tushar-N / hook_activations.py
Created August 3, 2018 00:06
Pytorch code to save activations for specific layers over an entire dataset
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as tmodels
from functools import partial
import collections
# dummy data: 10 batches of images with batch size 16
dataset = [torch.rand(16,3,224,224).cuda() for _ in range(10)]
@heroheman
heroheman / ranger-cheatsheet.md
Last active August 10, 2024 15:27
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@joyrexus
joyrexus / README.md
Last active August 6, 2024 16:07
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@alghanmi
alghanmi / curl_example.cpp
Created May 5, 2014 20:12
cURL C++ Example
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
@mitchwongho
mitchwongho / Docker
Last active June 26, 2024 07:28
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active August 23, 2024 23:19
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active August 25, 2024 00:32
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname