Skip to content

Instantly share code, notes, and snippets.

View ZaWertun's full-sized avatar
💻
💻🍕🍺

Yaroslav Sidlovsky ZaWertun

💻
💻🍕🍺
View GitHub Profile
@ZaWertun
ZaWertun / simple_chat.rs
Last active August 29, 2015 14:00 — forked from andelf/simple_chat.rs
compatible with rust 0.10
#![allow(unused_must_use)]
extern crate sync;
// str op trait
use std::str::StrSlice;
// for tcp listen
use std::io::{TcpListener, TcpStream};
use std::io::net::ip::SocketAddr;
// for trait
#!/usr/bin/env python3
import json
import urllib.request
rows = []
max_col_size = {0: 0, 1: 0, 2: 0}
nodes = json.loads(
urllib.request.urlopen("https://nodes.tox.chat/json").read().decode()
@ZaWertun
ZaWertun / firefox_clear_historyvisits.sh
Last active May 25, 2016 13:01
Clears Firefox history older than 30 days
#!/usr/bin/env bash
# Clears Firefox history older than 30 days
function clear_history() {
local db=$1
local visits="moz_historyvisits v, moz_places p where v.place_id = p.id and p.id not in (select distinct(fk) from moz_bookmarks) and v.visit_date < strftime('%s', 'now', '-30 day') * 1000000"
local count=$(echo "select count(*) from $visits;" | sqlite3 $db)
if [ $count -gt 0 ]; then
echo "$count history items will be deleted from $i"
@ZaWertun
ZaWertun / cloudSettings
Last active July 11, 2018 11:48
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-07-11T11:48:45.467Z","extensionVersion":"v2.9.2"}
# Code::Stats script for fish shell
# This code fragment must be placed in ~/.config/fish/config.fish
# License: MIT
if status is-interactive
set -g __code_stats_xp 0
set -g __code_stats_last (date +%s)
set -g __code_stats_version 0.1.0
function __code_stats_pulse -e __code_stats_event -p %self
if not set -q __code_stats_key; or test $__code_stats_xp -eq 0
QTabBar, QTabBar::tab {
color: #ffffff;
padding: 4px 0 2px 4px;
background-color: #4d4d4d;
}
QTabBar::tab:selected {
border-top: 2px solid #3ea8df;
}
diff --git a/kate/kate.spec b/kate/kate.spec
index 91d6300..3f53db8 100644
--- a/kate/kate.spec
+++ b/kate/kate.spec
@@ -90,6 +90,14 @@ Requires: %{name} = %{version}-%{release}
%description plugins
%{summary}.
+%package plugin-konsole
+Summary: Kate Konsole plugin
require "spec"
class GenericVersion
include Comparable(self)
getter parts : Array(String)
def initialize(parts : Array(String | Int32))
@parts = parts.map{|x| x.to_s}
end
diff -r -U3 sshuttle-1.0.1.orig/sshuttle/server.py sshuttle-1.0.1/sshuttle/server.py
--- sshuttle-1.0.1.orig/sshuttle/server.py 2020-06-05 00:43:00.000000000 +0300
+++ sshuttle-1.0.1/sshuttle/server.py 2020-07-01 12:18:01.086964478 +0300
@@ -6,7 +6,7 @@
import sys
import os
import platform
-from shutil import which
+import shutil
diff -r -U3 sshuttle-1.0.1.orig/sshuttle/ssnet.py sshuttle-1.0.1/sshuttle/ssnet.py
--- sshuttle-1.0.1.orig/sshuttle/ssnet.py 2020-06-05 00:43:00.000000000 +0300
+++ sshuttle-1.0.1/sshuttle/ssnet.py 2020-07-01 12:15:35.206952388 +0300
@@ -439,7 +439,8 @@
callback(cmd, data)
def flush(self):
- os.set_blocking(self.wfile.fileno(), False)
+ if 'set_blocking' in dir(os):
+ os.set_blocking(self.wfile.fileno(), False)